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

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

Issue 1690633002: Revert of Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e6c5bb8955466380685dc89dd5842fc7e2757e41..532cf018ff75835e539d3dc92fd89b18181a7961 100644
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -108,13 +108,8 @@
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();
}
}
@@ -194,8 +189,16 @@
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, DidStopLoadingDetails) {
+IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
+ MAYBE_DidStopLoadingDetails) {
ASSERT_TRUE(embedded_test_server()->Start());
LoadStopNotificationObserver load_observer(
@@ -209,15 +212,20 @@
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,
- DidStopLoadingDetailsWithPending) {
- ASSERT_TRUE(embedded_test_server()->Start());
- // 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");
+ MAYBE_DidStopLoadingDetailsWithPending) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+ GURL url("data:text/html,<div>test</div>");
// Listen for the first load to stop.
LoadStopNotificationObserver load_observer(
@@ -226,11 +234,11 @@
// We will hear a DidStopLoading from the first load as the new load
// is started.
NavigateOnCommitObserver commit_observer(
- shell(), url2);
- NavigateToURL(shell(), url1);
+ shell(), embedded_test_server()->GetURL("/title2.html"));
+ NavigateToURL(shell(), url);
load_observer.Wait();
- EXPECT_EQ(url1, load_observer.url_);
+ EXPECT_EQ(url, load_observer.url_);
EXPECT_EQ(0, load_observer.session_index_);
EXPECT_EQ(&shell()->web_contents()->GetController(),
load_observer.controller_);
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698