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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2661743002: PlzNavigate: Invoke didStartProvisionalLoad() when the renderer initiates a navigation in startLoad( (Closed)
Patch Set: Fix build error Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 7333 matching lines...) Expand 10 before | Expand all | Expand 10 after
7344 EXPECT_EQ(WebBackForwardCommit, client.lastCommitType()); 7344 EXPECT_EQ(WebBackForwardCommit, client.lastCommitType());
7345 } 7345 }
7346 7346
7347 class TestHistoryWebFrameClient : public FrameTestHelpers::TestWebFrameClient { 7347 class TestHistoryWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
7348 public: 7348 public:
7349 TestHistoryWebFrameClient() { 7349 TestHistoryWebFrameClient() {
7350 m_replacesCurrentHistoryItem = false; 7350 m_replacesCurrentHistoryItem = false;
7351 m_frame = nullptr; 7351 m_frame = nullptr;
7352 } 7352 }
7353 7353
7354 void didStartProvisionalLoad(WebLocalFrame* frame) { 7354 void didStartProvisionalLoad(WebLocalFrame* frame,
7355 const WebURLRequest& request) {
7355 WebDataSource* ds = frame->provisionalDataSource(); 7356 WebDataSource* ds = frame->provisionalDataSource();
7356 m_replacesCurrentHistoryItem = ds->replacesCurrentHistoryItem(); 7357 m_replacesCurrentHistoryItem = ds->replacesCurrentHistoryItem();
7357 m_frame = frame; 7358 m_frame = frame;
7358 } 7359 }
7359 7360
7360 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; } 7361 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; }
7361 WebFrame* frame() { return m_frame; } 7362 WebFrame* frame() { return m_frame; }
7362 7363
7363 private: 7364 private:
7364 bool m_replacesCurrentHistoryItem; 7365 bool m_replacesCurrentHistoryItem;
(...skipping 2711 matching lines...) Expand 10 before | Expand all | Expand 10 after
10076 10077
10077 class CallbackOrderingWebFrameClient 10078 class CallbackOrderingWebFrameClient
10078 : public FrameTestHelpers::TestWebFrameClient { 10079 : public FrameTestHelpers::TestWebFrameClient {
10079 public: 10080 public:
10080 CallbackOrderingWebFrameClient() : m_callbackCount(0) {} 10081 CallbackOrderingWebFrameClient() : m_callbackCount(0) {}
10081 10082
10082 void didStartLoading(bool toDifferentDocument) override { 10083 void didStartLoading(bool toDifferentDocument) override {
10083 EXPECT_EQ(0, m_callbackCount++); 10084 EXPECT_EQ(0, m_callbackCount++);
10084 FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument); 10085 FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument);
10085 } 10086 }
10086 void didStartProvisionalLoad(WebLocalFrame*) override { 10087 void didStartProvisionalLoad(WebLocalFrame*, const WebURLRequest&) override {
10087 EXPECT_EQ(1, m_callbackCount++); 10088 EXPECT_EQ(1, m_callbackCount++);
10088 } 10089 }
10089 void didCommitProvisionalLoad(WebLocalFrame*, 10090 void didCommitProvisionalLoad(WebLocalFrame*,
10090 const WebHistoryItem&, 10091 const WebHistoryItem&,
10091 WebHistoryCommitType) override { 10092 WebHistoryCommitType) override {
10092 EXPECT_EQ(2, m_callbackCount++); 10093 EXPECT_EQ(2, m_callbackCount++);
10093 } 10094 }
10094 void didFinishDocumentLoad(WebLocalFrame*) override { 10095 void didFinishDocumentLoad(WebLocalFrame*) override {
10095 EXPECT_EQ(3, m_callbackCount++); 10096 EXPECT_EQ(3, m_callbackCount++);
10096 } 10097 }
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
11257 11258
11258 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); 11259 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached());
11259 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); 11260 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading());
11260 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); 11261 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad());
11261 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); 11262 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents());
11262 11263
11263 webViewHelper.reset(); 11264 webViewHelper.reset();
11264 } 11265 }
11265 11266
11266 } // namespace blink 11267 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698