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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2478803003: Remove DOMAutomationController::automation_id_ (Closed)
Patch Set: More of: Fixing issues caught by extra |expected_response| checks in ExecuteScript function. Created 3 years, 5 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
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index ee5c40f911d8a41ffbab964a9c797b1cb69a9d76..723caacb0a2e12d915919a74891b3dc2236c0a77 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -2191,11 +2191,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// Navigate the iframe itself to about:blank using a script executing in its
// own context. It should stay in the same SiteInstance as before, not the
// parent one.
- std::string script(
- "window.domAutomationController.send("
- "window.location.href = 'about:blank');");
TestFrameNavigationObserver frame_observer(child);
- EXPECT_TRUE(ExecuteScript(child, script));
+ ExecuteUnmodifiedScript(child, "window.location.href = 'about:blank';");
frame_observer.Wait();
EXPECT_EQ(about_blank_url, child->current_url());
@@ -5452,14 +5449,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, SubframeWindowFocus) {
" domAutomationController.send('%s-lost-focus');"
"});";
std::string script = base::StringPrintf(kSetupFocusEvents, "main", "main");
- EXPECT_TRUE(ExecuteScript(shell(), script));
+ ExecuteUnmodifiedScript(shell(), script);
script = base::StringPrintf(kSetupFocusEvents, "child1", "child1");
- EXPECT_TRUE(ExecuteScript(child1, script));
+ ExecuteUnmodifiedScript(child1, script);
script = base::StringPrintf(kSetupFocusEvents, "child2", "child2");
- EXPECT_TRUE(ExecuteScript(child2, script));
+ ExecuteUnmodifiedScript(child2, script);
// Execute window.focus on the B subframe from the A main frame.
- EXPECT_TRUE(ExecuteScript(root, "frames[0].focus()"));
+ ExecuteUnmodifiedScript(root, "frames[0].focus()");
// Helper to wait for two specified messages to arrive on the specified
// DOMMessageQueue, assuming that the two messages can arrive in any order.
@@ -5489,7 +5486,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, SubframeWindowFocus) {
// Now, execute window.focus on the C subframe from A main frame. This
// checks that we can shift focus from one remote frame to another.
- EXPECT_TRUE(ExecuteScript(root, "frames[1].focus()"));
+ ExecuteUnmodifiedScript(root, "frames[1].focus()");
// Wait for the two subframes (B and C) to fire blur and focus events.
wait_for_two_messages(&msg_queue, "\"child1-lost-focus\"",
@@ -5499,7 +5496,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, SubframeWindowFocus) {
EXPECT_EQ(child2, root->frame_tree()->GetFocusedFrame());
// window.focus the main frame from the C subframe.
- EXPECT_TRUE(ExecuteScript(child2, "parent.focus()"));
+ ExecuteUnmodifiedScript(child2, "parent.focus()");
// Wait for the C subframe to blur and main frame to focus.
wait_for_two_messages(&msg_queue, "\"child2-lost-focus\"",
@@ -5643,8 +5640,6 @@ class SitePerProcessMouseWheelBrowserTest : public SitePerProcessBrowserTest {
"scroll_div = document.getElementById('scrollable_div');"
"scroll_div.addEventListener('wheel', wheel_handler);"
"scroll_div.addEventListener('scroll', scroll_handler);"
- "domAutomationController.setAutomationId(0);"
- "domAutomationController.send('wheel handler installed');"
"document.body.style.background = 'black';";
content::DOMMessageQueue msg_queue;
@@ -7848,10 +7843,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// Have the child frame navigate its parent to its SiteInstance.
GURL b_url(embedded_test_server()->GetURL("b.com", "/title1.html"));
- std::string script = base::StringPrintf(
- "window.domAutomationController.send("
- "parent.location = '%s');",
- b_url.spec().c_str());
+ std::string script =
+ base::StringPrintf("parent.location = '%s';", b_url.spec().c_str());
// Ensure the child has received a user gesture, so that it has permission
// to framebust.

Powered by Google App Engine
This is Rietveld 408576698