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

Side by Side Diff: chrome/browser/chrome_site_per_process_browsertest.cc

Issue 2478803003: Remove DOMAutomationController::automation_id_ (Closed)
Patch Set: Rebasing... 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <utility> 5 #include <utility>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 EXPECT_TRUE(WaitForLoadStop(popup)); 257 EXPECT_TRUE(WaitForLoadStop(popup));
258 EXPECT_EQ(popup_url, popup->GetLastCommittedURL()); 258 EXPECT_EQ(popup_url, popup->GetLastCommittedURL());
259 EXPECT_NE(popup, web_contents); 259 EXPECT_NE(popup, web_contents);
260 260
261 // Switch focus to the original tab, since opening a popup also focused it. 261 // Switch focus to the original tab, since opening a popup also focused it.
262 web_contents->GetDelegate()->ActivateContents(web_contents); 262 web_contents->GetDelegate()->ActivateContents(web_contents);
263 EXPECT_EQ(web_contents, browser()->tab_strip_model()->GetActiveWebContents()); 263 EXPECT_EQ(web_contents, browser()->tab_strip_model()->GetActiveWebContents());
264 264
265 // Focus the popup via window.focus(). 265 // Focus the popup via window.focus().
266 content::DOMMessageQueue queue; 266 content::DOMMessageQueue queue;
267 EXPECT_TRUE(ExecuteScript(web_contents, "focusPopup()")); 267 ExecuteScriptAsync(web_contents, "focusPopup()");
268 268
269 // Wait for main page to lose focus and for popup to gain focus. Each event 269 // Wait for main page to lose focus and for popup to gain focus. Each event
270 // will send a message, and the two messages can arrive in any order. 270 // will send a message, and the two messages can arrive in any order.
271 std::string status; 271 std::string status;
272 bool main_lost_focus = false; 272 bool main_lost_focus = false;
273 bool popup_got_focus = false; 273 bool popup_got_focus = false;
274 while (queue.WaitForMessage(&status)) { 274 while (queue.WaitForMessage(&status)) {
275 if (status == "\"main-lost-focus\"") 275 if (status == "\"main-lost-focus\"")
276 main_lost_focus = true; 276 main_lost_focus = true;
277 if (status == "\"popup-got-focus\"") 277 if (status == "\"popup-got-focus\"")
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 TestSpellCheckPanelHost* host = 850 TestSpellCheckPanelHost* host =
851 browser_client.GetTestSpellCheckPanelHostForProcess( 851 browser_client.GetTestSpellCheckPanelHostForProcess(
852 cross_site_subframe->GetProcess()); 852 cross_site_subframe->GetProcess());
853 EXPECT_TRUE(host->SpellingPanelVisible()); 853 EXPECT_TRUE(host->SpellingPanelVisible());
854 854
855 content::SetBrowserClientForTesting(old_browser_client); 855 content::SetBrowserClientForTesting(old_browser_client);
856 } 856 }
857 #endif // BUILDFLAG(HAS_SPELLCHECK_PANEL) 857 #endif // BUILDFLAG(HAS_SPELLCHECK_PANEL)
858 858
859 #endif // BUILDFLAG(ENABLE_SPELLCHECK) 859 #endif // BUILDFLAG(ENABLE_SPELLCHECK)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698