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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/devtools/devtools_agent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/devtools_protocol_browsertest.cc
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
index 329de081754e2baf8f2e74ab8401e16972fd23a2..3f471114c644b21b641cf2346688d2e549b3723e 100644
--- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
+++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -488,4 +488,30 @@ IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, ReloadBlankPage) {
// Should not crash at this point.
}
+IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, EvaluateInBlankPage) {
+ NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1);
+ Attach();
+ scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
+ params->SetString("expression", "window");
+ SendCommand("Runtime.evaluate", std::move(params), true);
+ bool wasThrown = true;
+ EXPECT_TRUE(result_->GetBoolean("wasThrown", &wasThrown));
+ EXPECT_FALSE(wasThrown);
+}
+
+IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest,
+ EvaluateInBlankPageAfterNavigation) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+ GURL test_url = embedded_test_server()->GetURL("/devtools/navigation.html");
+ NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1);
+ Attach();
+ NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1);
+ scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue());
+ params->SetString("expression", "window");
+ SendCommand("Runtime.evaluate", std::move(params), true);
+ bool wasThrown = true;
+ EXPECT_TRUE(result_->GetBoolean("wasThrown", &wasThrown));
+ EXPECT_FALSE(wasThrown);
+}
+
} // namespace content
« 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