Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1488)

Unified Diff: content/browser/web_contents/web_contents_impl_browsertest.cc

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed issue with tests Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e6c5bb8955466380685dc89dd5842fc7e2757e41 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) {
ASSERT_TRUE(embedded_test_server()->Start());
LoadStopNotificationObserver load_observer(
@@ -212,20 +209,15 @@ 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) {
ASSERT_TRUE(embedded_test_server()->Start());
- GURL url("data:text/html,<div>test</div>");
+ // TODO(clamy): Add a cross-process navigation case as well once
+ // crbug.com/581024 is fixed.
+ 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 +226,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_);

Powered by Google App Engine
This is Rietveld 408576698