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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_browsertest.cc

Issue 2522733002: Do not prompt for reload when security panel is opened on an interstitial (Closed)
Patch Set: remove isInterstitialShowing setter Created 4 years 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
« no previous file with comments | « no previous file | content/browser/devtools/protocol/page_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 1319
1320 command_params.reset(new base::DictionaryValue()); 1320 command_params.reset(new base::DictionaryValue());
1321 command_params->SetString("targetId", attached_id); 1321 command_params->SetString("targetId", attached_id);
1322 SendCommand("Target.detachFromTarget", std::move(command_params), true); 1322 SendCommand("Target.detachFromTarget", std::move(command_params), true);
1323 params = WaitForNotification("Target.detachedFromTarget", true); 1323 params = WaitForNotification("Target.detachedFromTarget", true);
1324 EXPECT_TRUE(params->GetString("targetId", &temp)); 1324 EXPECT_TRUE(params->GetString("targetId", &temp));
1325 EXPECT_EQ(attached_id, temp); 1325 EXPECT_EQ(attached_id, temp);
1326 EXPECT_TRUE(notifications_.empty()); 1326 EXPECT_TRUE(notifications_.empty());
1327 } 1327 }
1328 1328
1329 // Tests that an interstitialShown event is sent when an interstitial is showing
1330 // on attach.
1331 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, InterstitialShownOnAttach) {
1332 TestInterstitialDelegate* delegate = new TestInterstitialDelegate;
1333 WebContentsImpl* web_contents =
1334 static_cast<WebContentsImpl*>(shell()->web_contents());
1335 GURL interstitial_url("https://example.test");
1336 InterstitialPageImpl* interstitial = new InterstitialPageImpl(
1337 web_contents, static_cast<RenderWidgetHostDelegate*>(web_contents), true,
1338 interstitial_url, delegate);
1339 interstitial->Show();
1340 WaitForInterstitialAttach(web_contents);
1341 Attach();
1342 SendCommand("Page.enable", nullptr, false);
1343 WaitForNotification("Page.interstitialShown", true);
1344 }
1345
1329 class SitePerProcessDevToolsProtocolTest : public DevToolsProtocolTest { 1346 class SitePerProcessDevToolsProtocolTest : public DevToolsProtocolTest {
1330 public: 1347 public:
1331 void SetUpCommandLine(base::CommandLine* command_line) override { 1348 void SetUpCommandLine(base::CommandLine* command_line) override {
1332 DevToolsProtocolTest::SetUpCommandLine(command_line); 1349 DevToolsProtocolTest::SetUpCommandLine(command_line);
1333 IsolateAllSitesForTesting(command_line); 1350 IsolateAllSitesForTesting(command_line);
1334 }; 1351 };
1335 1352
1336 void SetUpOnMainThread() override { 1353 void SetUpOnMainThread() override {
1337 DevToolsProtocolTest::SetUpOnMainThread(); 1354 DevToolsProtocolTest::SetUpOnMainThread();
1338 host_resolver()->AddRule("*", "127.0.0.1"); 1355 host_resolver()->AddRule("*", "127.0.0.1");
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 command_params.reset(new base::DictionaryValue()); 1412 command_params.reset(new base::DictionaryValue());
1396 command_params->SetBoolean("autoAttach", false); 1413 command_params->SetBoolean("autoAttach", false);
1397 command_params->SetBoolean("waitForDebuggerOnStart", false); 1414 command_params->SetBoolean("waitForDebuggerOnStart", false);
1398 SendCommand("Target.setAutoAttach", std::move(command_params), false); 1415 SendCommand("Target.setAutoAttach", std::move(command_params), false);
1399 params = WaitForNotification("Target.detachedFromTarget", true); 1416 params = WaitForNotification("Target.detachedFromTarget", true);
1400 EXPECT_TRUE(params->GetString("targetId", &temp)); 1417 EXPECT_TRUE(params->GetString("targetId", &temp));
1401 EXPECT_EQ(target_id, temp); 1418 EXPECT_EQ(target_id, temp);
1402 } 1419 }
1403 1420
1404 } // namespace content 1421 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/protocol/page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698