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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_interactive_test.cc

Issue 2419763002: Enable ExtensionTabsTest.QueryLastFocusedWindowTabs test (Closed)
Patch Set: utilizing BrowserActivationWaiter test support Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc b/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
index 879acfef8deb27f36afc7027309d4be2237b7ae1..db45de15b0c058da41524ffc5a61a487b2778b75 100644
--- a/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
@@ -69,8 +69,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, MAYBE_GetLastFocusedWindow) {
EXPECT_TRUE(result.get()->GetList(keys::kTabsKey, &tabs));
}
-// Flaky: http://crbug.com/136562
-IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_QueryLastFocusedWindowTabs) {
+IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, QueryLastFocusedWindowTabs) {
const size_t kExtraWindows = 2;
for (size_t i = 0; i < kExtraWindows; ++i)
CreateBrowser(browser()->profile());
@@ -82,11 +81,10 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_QueryLastFocusedWindowTabs) {
ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
focused_window->window()->GetNativeWindow()));
#endif
+ ui_test_utils::BrowserActivationWaiter waiter(focused_window);
+ waiter.WaitForActivation();
- // Needed on Mac and Linux so that the BrowserWindow::IsActive calls work.
- content::RunAllPendingInMessageLoop();
-
- GURL url;
+ GURL url("about:blank");
AddTabAtIndexToBrowser(focused_window, 0, url, ui::PAGE_TRANSITION_LINK,
true);
int focused_window_id =
@@ -95,6 +93,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_QueryLastFocusedWindowTabs) {
// Get tabs in the 'last focused' window called from non-focused browser.
scoped_refptr<extensions::TabsQueryFunction> function =
new extensions::TabsQueryFunction();
+ scoped_refptr<extensions::Extension> extension(
+ extensions::test_util::CreateEmptyExtension());
+ function->set_extension(extension.get());
std::unique_ptr<base::ListValue> result(
utils::ToList(utils::RunFunctionAndReturnSingleResult(
function.get(), "[{\"lastFocusedWindow\":true}]", browser())));
@@ -111,6 +112,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_QueryLastFocusedWindowTabs) {
// Get tabs NOT in the 'last focused' window called from the focused browser.
function = new extensions::TabsQueryFunction();
+ function->set_extension(extension.get());
result.reset(utils::ToList(
utils::RunFunctionAndReturnSingleResult(function.get(),
"[{\"lastFocusedWindow\":false}]",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698