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

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

Issue 1976573002: Only use pending navigation params for browser-initiated navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: consistency Created 4 years, 7 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 5789 matching lines...) Expand 10 before | Expand all | Expand 10 after
5800 Platform::current()->getURLLoaderMockFactory()->registerURL(redirectURL, fin alResponse, filePath); 5800 Platform::current()->getURLLoaderMockFactory()->registerURL(redirectURL, fin alResponse, filePath);
5801 5801
5802 FrameTestHelpers::WebViewHelper webViewHelper(this); 5802 FrameTestHelpers::WebViewHelper webViewHelper(this);
5803 webViewHelper.initializeAndLoad(m_baseURL + "first_party_redirect.html", tru e); 5803 webViewHelper.initializeAndLoad(m_baseURL + "first_party_redirect.html", tru e);
5804 EXPECT_TRUE(webViewHelper.webView()->mainFrame()->document().firstPartyForCo okies() == redirectURL); 5804 EXPECT_TRUE(webViewHelper.webView()->mainFrame()->document().firstPartyForCo okies() == redirectURL);
5805 } 5805 }
5806 5806
5807 class TestNavigationPolicyWebFrameClient : public FrameTestHelpers::TestWebFrame Client { 5807 class TestNavigationPolicyWebFrameClient : public FrameTestHelpers::TestWebFrame Client {
5808 public: 5808 public:
5809 5809
5810 void didNavigateWithinPage(WebLocalFrame*, const WebHistoryItem&, WebHistory CommitType) override 5810 void didNavigateWithinPage(WebLocalFrame*, const WebHistoryItem&, WebHistory CommitType, bool) override
5811 { 5811 {
5812 EXPECT_TRUE(false); 5812 EXPECT_TRUE(false);
5813 } 5813 }
5814 }; 5814 };
5815 5815
5816 TEST_P(ParameterizedWebFrameTest, SimulateFragmentAnchorMiddleClick) 5816 TEST_P(ParameterizedWebFrameTest, SimulateFragmentAnchorMiddleClick)
5817 { 5817 {
5818 registerMockedHttpURLLoad("fragment_middle_click.html"); 5818 registerMockedHttpURLLoad("fragment_middle_click.html");
5819 TestNavigationPolicyWebFrameClient client; 5819 TestNavigationPolicyWebFrameClient client;
5820 FrameTestHelpers::WebViewHelper webViewHelper(this); 5820 FrameTestHelpers::WebViewHelper webViewHelper(this);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
6201 EXPECT_EQ(client.differentDocumentStartCount(), 1); 6201 EXPECT_EQ(client.differentDocumentStartCount(), 1);
6202 } 6202 }
6203 6203
6204 class TestDidNavigateCommitTypeWebFrameClient : public FrameTestHelpers::TestWeb FrameClient { 6204 class TestDidNavigateCommitTypeWebFrameClient : public FrameTestHelpers::TestWeb FrameClient {
6205 public: 6205 public:
6206 TestDidNavigateCommitTypeWebFrameClient() 6206 TestDidNavigateCommitTypeWebFrameClient()
6207 : m_lastCommitType(WebHistoryInertCommit) 6207 : m_lastCommitType(WebHistoryInertCommit)
6208 { 6208 {
6209 } 6209 }
6210 6210
6211 void didNavigateWithinPage(WebLocalFrame*, const WebHistoryItem&, WebHistory CommitType type) override 6211 void didNavigateWithinPage(WebLocalFrame*, const WebHistoryItem&, WebHistory CommitType type, bool) override
6212 { 6212 {
6213 m_lastCommitType = type; 6213 m_lastCommitType = type;
6214 } 6214 }
6215 6215
6216 WebHistoryCommitType lastCommitType() const { return m_lastCommitType; } 6216 WebHistoryCommitType lastCommitType() const { return m_lastCommitType; }
6217 6217
6218 private: 6218 private:
6219 WebHistoryCommitType m_lastCommitType; 6219 WebHistoryCommitType m_lastCommitType;
6220 }; 6220 };
6221 6221
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
8682 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame(); 8682 WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame();
8683 v8::HandleScope scope(v8::Isolate::GetCurrent()); 8683 v8::HandleScope scope(v8::Isolate::GetCurrent());
8684 mainFrame->executeScript(WebScriptSource("hello = 'world';")); 8684 mainFrame->executeScript(WebScriptSource("hello = 'world';"));
8685 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page"); 8685 FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page");
8686 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri ptSource("hello")); 8686 v8::Local<v8::Value> result = mainFrame->executeScriptAndReturnValue(WebScri ptSource("hello"));
8687 ASSERT_TRUE(result->IsString()); 8687 ASSERT_TRUE(result->IsString());
8688 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC ontext()).ToLocalChecked())); 8688 EXPECT_EQ("world", toCoreString(result->ToString(mainFrame->mainWorldScriptC ontext()).ToLocalChecked()));
8689 } 8689 }
8690 8690
8691 } // namespace blink 8691 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698