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

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

Issue 1873533002: [DevTools] Force context creation when runtime is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 4 years, 8 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
« no previous file with comments | « no previous file | content/renderer/devtools/devtools_agent.h » ('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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 shell()->web_contents()->GetBrowserContext(), 481 shell()->web_contents()->GetBrowserContext(),
482 GURL("javascript:x=1"), 482 GURL("javascript:x=1"),
483 nullptr, 483 nullptr,
484 gfx::Size()); 484 gfx::Size());
485 WaitForLoadStop(window->web_contents()); 485 WaitForLoadStop(window->web_contents());
486 Attach(); 486 Attach();
487 SendCommand("Page.reload", nullptr, false); 487 SendCommand("Page.reload", nullptr, false);
488 // Should not crash at this point. 488 // Should not crash at this point.
489 } 489 }
490 490
491 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, EvaluateInBlankPage) {
492 NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1);
493 Attach();
494 scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
495 params->SetString("expression", "window");
496 SendCommand("Runtime.evaluate", std::move(params), true);
497 bool wasThrown = true;
498 EXPECT_TRUE(result_->GetBoolean("wasThrown", &wasThrown));
499 EXPECT_FALSE(wasThrown);
500 }
501
502 IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest,
503 EvaluateInBlankPageAfterNavigation) {
504 ASSERT_TRUE(embedded_test_server()->Start());
505 GURL test_url = embedded_test_server()->GetURL("/devtools/navigation.html");
506 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1);
507 Attach();
508 NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1);
509 scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
510 params->SetString("expression", "window");
511 SendCommand("Runtime.evaluate", std::move(params), true);
512 bool wasThrown = true;
513 EXPECT_TRUE(result_->GetBoolean("wasThrown", &wasThrown));
514 EXPECT_FALSE(wasThrown);
515 }
516
491 } // namespace content 517 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/devtools/devtools_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698