Enable content_browsertests to check page load success.
commit0785dd768276f65f0d9ca6c729872e1dd7dd4796
authoralexmos <alexmos@chromium.org>
Thu, 13 Nov 2014 19:59:38 +0000 (13 11:59 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 13 Nov 2014 20:00:08 +0000 (13 20:00 +0000)
treecfbf92608e394350e22d23ebfd3faf24ff5c08e8
parent5b3dce0d316928cecab45b24a889554dee25dee8
Enable content_browsertests to check page load success.

Currently, many tests do not check whether test page loads actually succeed (see bug for more details).  This CL makes this possible and refactors a few tests in RenderFrameHostManagerTest.* as examples of using the new patterns.

Instead of saying NavigateToURL(w, url), tests can use EXPECT_TRUE(NavigateToURL(w, url)) for pages that are expected to load successfully.  This will verify that the last navigation didn't result in an error page or an interstitial, and also checks that the last committed URL matches what we wanted to navigate to.  For navigations that don't commit (e.g., crashes), tests can use EXPECT_TRUE(NavigateToURLAndExpectNoCommit(w, url).

Similarly, tests can use EXPECT_TRUE(WaitForLoadStop(w)) to wait for navigations that should succeed.

BUG=425335

Review URL: https://codereview.chromium.org/681113002

Cr-Commit-Position: refs/heads/master@{#304064}
chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
chrome/browser/extensions/api/tabs/tabs_test.cc
chrome/browser/extensions/content_verifier_browsertest.cc
chrome/test/base/in_process_browser_test.cc
chrome/test/base/in_process_browser_test.h
content/browser/frame_host/render_frame_host_manager_browsertest.cc
content/browser/renderer_host/render_process_host_browsertest.cc
content/public/test/browser_test_utils.cc
content/public/test/browser_test_utils.h
content/public/test/content_browser_test_utils.cc
content/public/test/content_browser_test_utils.h