OLD | NEW |
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 7307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7318 FrameLoadTypeBackForward, item.get(), HistorySameDocumentLoad); | 7318 FrameLoadTypeBackForward, item.get(), HistorySameDocumentLoad); |
7319 EXPECT_EQ(WebBackForwardCommit, client.lastCommitType()); | 7319 EXPECT_EQ(WebBackForwardCommit, client.lastCommitType()); |
7320 } | 7320 } |
7321 | 7321 |
7322 class TestHistoryWebFrameClient : public FrameTestHelpers::TestWebFrameClient { | 7322 class TestHistoryWebFrameClient : public FrameTestHelpers::TestWebFrameClient { |
7323 public: | 7323 public: |
7324 TestHistoryWebFrameClient() { | 7324 TestHistoryWebFrameClient() { |
7325 m_replacesCurrentHistoryItem = false; | 7325 m_replacesCurrentHistoryItem = false; |
7326 } | 7326 } |
7327 | 7327 |
7328 void didStartProvisionalLoad(WebDataSource* dataSource) { | 7328 void didStartProvisionalLoad(WebDataSource* dataSource, |
| 7329 WebURLRequest& request) { |
7329 m_replacesCurrentHistoryItem = dataSource->replacesCurrentHistoryItem(); | 7330 m_replacesCurrentHistoryItem = dataSource->replacesCurrentHistoryItem(); |
7330 } | 7331 } |
7331 | 7332 |
7332 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; } | 7333 bool replacesCurrentHistoryItem() { return m_replacesCurrentHistoryItem; } |
7333 | 7334 |
7334 private: | 7335 private: |
7335 bool m_replacesCurrentHistoryItem; | 7336 bool m_replacesCurrentHistoryItem; |
7336 }; | 7337 }; |
7337 | 7338 |
7338 // Tests that the first navigation in an initially blank subframe will result in | 7339 // Tests that the first navigation in an initially blank subframe will result in |
(...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10082 | 10083 |
10083 class CallbackOrderingWebFrameClient | 10084 class CallbackOrderingWebFrameClient |
10084 : public FrameTestHelpers::TestWebFrameClient { | 10085 : public FrameTestHelpers::TestWebFrameClient { |
10085 public: | 10086 public: |
10086 CallbackOrderingWebFrameClient() : m_callbackCount(0) {} | 10087 CallbackOrderingWebFrameClient() : m_callbackCount(0) {} |
10087 | 10088 |
10088 void didStartLoading(bool toDifferentDocument) override { | 10089 void didStartLoading(bool toDifferentDocument) override { |
10089 EXPECT_EQ(0, m_callbackCount++); | 10090 EXPECT_EQ(0, m_callbackCount++); |
10090 FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument); | 10091 FrameTestHelpers::TestWebFrameClient::didStartLoading(toDifferentDocument); |
10091 } | 10092 } |
10092 void didStartProvisionalLoad(WebDataSource*) override { | 10093 void didStartProvisionalLoad(WebDataSource*, WebURLRequest&) override { |
10093 EXPECT_EQ(1, m_callbackCount++); | 10094 EXPECT_EQ(1, m_callbackCount++); |
10094 } | 10095 } |
10095 void didCommitProvisionalLoad(WebLocalFrame*, | 10096 void didCommitProvisionalLoad(WebLocalFrame*, |
10096 const WebHistoryItem&, | 10097 const WebHistoryItem&, |
10097 WebHistoryCommitType) override { | 10098 WebHistoryCommitType) override { |
10098 EXPECT_EQ(2, m_callbackCount++); | 10099 EXPECT_EQ(2, m_callbackCount++); |
10099 } | 10100 } |
10100 void didFinishDocumentLoad(WebLocalFrame*) override { | 10101 void didFinishDocumentLoad(WebLocalFrame*) override { |
10101 EXPECT_EQ(3, m_callbackCount++); | 10102 EXPECT_EQ(3, m_callbackCount++); |
10102 } | 10103 } |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11362 FrameTestHelpers::WebViewHelper openerHelper; | 11363 FrameTestHelpers::WebViewHelper openerHelper; |
11363 openerHelper.initialize(false, nullptr, &openerWebViewClient); | 11364 openerHelper.initialize(false, nullptr, &openerWebViewClient); |
11364 FrameTestHelpers::WebViewHelper helper; | 11365 FrameTestHelpers::WebViewHelper helper; |
11365 helper.initializeWithOpener(openerHelper.webView()->mainFrame()); | 11366 helper.initializeWithOpener(openerHelper.webView()->mainFrame()); |
11366 | 11367 |
11367 openerHelper.reset(); | 11368 openerHelper.reset(); |
11368 EXPECT_EQ(nullptr, helper.webView()->mainFrameImpl()->opener()); | 11369 EXPECT_EQ(nullptr, helper.webView()->mainFrameImpl()->opener()); |
11369 } | 11370 } |
11370 | 11371 |
11371 } // namespace blink | 11372 } // namespace blink |
OLD | NEW |