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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 1381003004: Better distinguish didFinishLoad and didStopLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « third_party/WebKit/Source/web/WebFrame.cpp ('k') | third_party/WebKit/public/web/WebFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 4732abbea43b1ee1d7ee0c29d14729912d97a4f6..b9f947c2968da437d5234c3440b23bef7f937810 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -8232,4 +8232,36 @@ TEST_F(WebFrameTest, ImageDocumentLoadFinishTime)
EXPECT_EQ(loader->timing().responseEnd(), resource->loadFinishTime());
}
+class CallbackOrderingWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
+public:
+ CallbackOrderingWebFrameClient() : m_callbackCount(0) { }
+
+ void didStartLoading(bool toDifferentDocument) override
+ {
+ EXPECT_EQ(0, m_callbackCount++);
+ FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument);
+ }
+ void didStartProvisionalLoad(WebLocalFrame*, double) override { EXPECT_EQ(1, m_callbackCount++); }
+ void didCommitProvisionalLoad(WebLocalFrame*, const WebHistoryItem&, WebHistoryCommitType) override { EXPECT_EQ(2, m_callbackCount++); }
+ void didFinishDocumentLoad(WebLocalFrame*, bool documentIsEmpty) override { EXPECT_EQ(3, m_callbackCount++); }
+ void didHandleOnloadEvents(WebLocalFrame*) override { EXPECT_EQ(4, m_callbackCount++); }
+ void didFinishLoad(WebLocalFrame*) override { EXPECT_EQ(5, m_callbackCount++); }
+ void didStopLoading() override
+ {
+ EXPECT_EQ(6, m_callbackCount++);
+ FrameTestHelpers::TestWebFrameClient::didStopLoading();
+ }
+
+private:
+ int m_callbackCount;
+};
+
+TEST_F(WebFrameTest, CallbackOrdering)
+{
+ registerMockedHttpURLLoad("foo.html");
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ CallbackOrderingWebFrameClient client;
+ webViewHelper.initializeAndLoad(m_baseURL + "foo.html", true, &client);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/WebFrame.cpp ('k') | third_party/WebKit/public/web/WebFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698