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

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 compile failures 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 WebDataSource* ds = frame->provisionalDataSource(); 7355 WebDataSource* dataSource) {
7356 m_replacesCurrentHistoryItem = ds->replacesCurrentHistoryItem(); 7356 m_replacesCurrentHistoryItem = dataSource->replacesCurrentHistoryItem();
7357 m_frame = frame; 7357 m_frame = frame;
7358 } 7358 }
7359 7359
7360 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; } 7360 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; }
7361 WebFrame* frame() { return m_frame; } 7361 WebFrame* frame() { return m_frame; }
7362 7362
7363 private: 7363 private:
7364 bool m_replacesCurrentHistoryItem; 7364 bool m_replacesCurrentHistoryItem;
7365 WebFrame* m_frame; 7365 WebFrame* m_frame;
7366 }; 7366 };
(...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after
10076 10076
10077 class CallbackOrderingWebFrameClient 10077 class CallbackOrderingWebFrameClient
10078 : public FrameTestHelpers::TestWebFrameClient { 10078 : public FrameTestHelpers::TestWebFrameClient {
10079 public: 10079 public:
10080 CallbackOrderingWebFrameClient() : m_callbackCount(0) {} 10080 CallbackOrderingWebFrameClient() : m_callbackCount(0) {}
10081 10081
10082 void didStartLoading(bool toDifferentDocument) override { 10082 void didStartLoading(bool toDifferentDocument) override {
10083 EXPECT_EQ(0, m_callbackCount++); 10083 EXPECT_EQ(0, m_callbackCount++);
10084 FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument); 10084 FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument);
10085 } 10085 }
10086 void didStartProvisionalLoad(WebLocalFrame*) override { 10086 void didStartProvisionalLoad(WebLocalFrame*, WebDataSource*) override {
10087 EXPECT_EQ(1, m_callbackCount++); 10087 EXPECT_EQ(1, m_callbackCount++);
10088 } 10088 }
10089 void didCommitProvisionalLoad(WebLocalFrame*, 10089 void didCommitProvisionalLoad(WebLocalFrame*,
10090 const WebHistoryItem&, 10090 const WebHistoryItem&,
10091 WebHistoryCommitType) override { 10091 WebHistoryCommitType) override {
10092 EXPECT_EQ(2, m_callbackCount++); 10092 EXPECT_EQ(2, m_callbackCount++);
10093 } 10093 }
10094 void didFinishDocumentLoad(WebLocalFrame*) override { 10094 void didFinishDocumentLoad(WebLocalFrame*) override {
10095 EXPECT_EQ(3, m_callbackCount++); 10095 EXPECT_EQ(3, m_callbackCount++);
10096 } 10096 }
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
11257 11257
11258 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); 11258 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached());
11259 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); 11259 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading());
11260 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); 11260 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad());
11261 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); 11261 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents());
11262 11262
11263 webViewHelper.reset(); 11263 webViewHelper.reset();
11264 } 11264 }
11265 11265
11266 } // namespace blink 11266 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698