Index: content/browser/web_contents/web_contents_impl_browsertest.cc |
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc |
index 532cf018ff75835e539d3dc92fd89b18181a7961..088232c43171c02944c7a51a66889622cd82e178 100644 |
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc |
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc |
@@ -108,8 +108,13 @@ class NavigateOnCommitObserver : public WebContentsObserver { |
const LoadCommittedDetails& load_details) override { |
if (!done_) { |
done_ = true; |
- shell_->Stop(); |
shell_->LoadURL(url_); |
+ |
+ // There should be a pending entry. |
+ CHECK(shell_->web_contents()->GetController().GetPendingEntry()); |
+ |
+ // Now that there is a pending entry, stop the load. |
+ shell_->Stop(); |
} |
} |
@@ -189,16 +194,8 @@ class LoadingStateChangedDelegate : public WebContentsDelegate { |
int loadingStateToDifferentDocumentCount_; |
}; |
-// See: http://crbug.com/298193 |
-#if defined(OS_WIN) || defined(OS_LINUX) |
-#define MAYBE_DidStopLoadingDetails DISABLED_DidStopLoadingDetails |
-#else |
-#define MAYBE_DidStopLoadingDetails DidStopLoadingDetails |
-#endif |
- |
// Test that DidStopLoading includes the correct URL in the details. |
-IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, |
- MAYBE_DidStopLoadingDetails) { |
+IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, DidStopLoadingDetails) { |
clamy
2016/01/25 14:01:18
It appears that the patch fixed the flakyness on t
|
ASSERT_TRUE(embedded_test_server()->Start()); |
LoadStopNotificationObserver load_observer( |
@@ -212,20 +209,13 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, |
load_observer.controller_); |
} |
-// See: http://crbug.com/298193 |
-#if defined(OS_WIN) || defined(OS_LINUX) |
-#define MAYBE_DidStopLoadingDetailsWithPending \ |
- DISABLED_DidStopLoadingDetailsWithPending |
-#else |
-#define MAYBE_DidStopLoadingDetailsWithPending DidStopLoadingDetailsWithPending |
-#endif |
- |
// Test that DidStopLoading includes the correct URL in the details when a |
// pending entry is present. |
IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, |
- MAYBE_DidStopLoadingDetailsWithPending) { |
+ DidStopLoadingDetailsWithPending) { |
clamy
2016/01/25 14:01:18
Same here, but I had to rewrite part of the test t
nasko
2016/01/26 01:34:27
Should there be a TODO to cover this case or do yo
clamy
2016/01/28 13:52:21
I added a TODO not to forget about it.
|
ASSERT_TRUE(embedded_test_server()->Start()); |
- GURL url("data:text/html,<div>test</div>"); |
+ GURL url1 = embedded_test_server()->GetURL("/title1.html"); |
+ GURL url2 = embedded_test_server()->GetURL("/title2.html"); |
// Listen for the first load to stop. |
LoadStopNotificationObserver load_observer( |
@@ -234,11 +224,11 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, |
// We will hear a DidStopLoading from the first load as the new load |
// is started. |
NavigateOnCommitObserver commit_observer( |
- shell(), embedded_test_server()->GetURL("/title2.html")); |
- NavigateToURL(shell(), url); |
+ shell(), url2); |
+ NavigateToURL(shell(), url1); |
load_observer.Wait(); |
- EXPECT_EQ(url, load_observer.url_); |
+ EXPECT_EQ(url1, load_observer.url_); |
EXPECT_EQ(0, load_observer.session_index_); |
EXPECT_EQ(&shell()->web_contents()->GetController(), |
load_observer.controller_); |