On Wed, Jan 6, 2010 at 1:16 PM, hap 497 <[email protected]> wrote:
> Thank you.
>
> Is there any test which makes Chromium loads a page using HTTP post?
> Similar to some of Chromium loads a page using AutomationProvider's
> NavigateToURL (which uses HTTP GET).

Yes, there are some ui-tests which do HTTP post.

One way to do a POST from a UI test is to use NavigateToURL(), and as
URL specify javascript code that posts a form:

    tab->NavigateToURL(GURL("javascript:documents.forms['myform'].submit()"));

This should navigate the page, and as long as 'myform' sets
method=POST it will be a POST.

You can see this type of technique in usage here:

   
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/session_history_uitest.cc

That test does a POST to '/echotitle' indirectly by calling
"javascript:submitForm()" on this HTML page:
    
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/session_history/form.html?view=markup

If you want to find other examples of POST, take a look at
'_post_handlers' variable in:
    
http://src.chromium.org/viewvc/chrome/trunk/src/net/tools/testserver/testserver.py?view=markup

to see all of the URLs registered as POST handlers

>
>
>
> On Wed, Jan 6, 2010 at 10:08 AM, Darin Fisher <[email protected]> wrote:
>> There are numerous POST related tests in url_request_unittest.cc
>> -Darin
>>
>> On Wed, Jan 6, 2010 at 9:26 AM, hap 497 <[email protected]> wrote:
>>>
>>> Hi,
>>>
>>> Can you please tell me if there is Chromium Unit Test Case for HTTP Post?
>>> All the test cases I found are doing HTTP Get.  And in the
>>> AutomationProvider, there is only a NavigateToURL function. I think
>>> there is only for HTTP Get.
>>>
>>> Thank you for any suggestion.
>>>
>>> --
>>> Chromium Developers mailing list: [email protected]
>>> View archives, change email options, or unsubscribe:
>>>    http://groups.google.com/group/chromium-dev
>>
>>
>
> --
> Chromium Developers mailing list: [email protected]
> View archives, change email options, or unsubscribe:
>    http://groups.google.com/group/chromium-dev
>
-- 
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to