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

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

Issue 2500093003: Re-enable tabs_interactive_uitest for linux_aura (Closed)
Patch Set: Created 4 years, 1 month 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: 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 db45de15b0c058da41524ffc5a61a487b2778b75..d5000c0eac35798a08d8ca4e6b2dd50a9c53d8b1 100644
--- a/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_interactive_test.cc
@@ -12,18 +12,17 @@
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_window.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
-#include "chrome/test/base/ui_test_utils.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/common/test_util.h"
-namespace api_test_utils = extensions::api_test_utils;
-namespace keys = extensions::tabs_constants;
+namespace extensions {
+
+namespace keys = tabs_constants;
namespace utils = extension_function_test_utils;
-typedef InProcessBrowserTest ExtensionTabsTest;
+using ExtensionTabsTest = InProcessBrowserTest;
// http://crbug.com/154081 for Aura specific
// http://crbug.com/179063 for other general failures on try bots.
@@ -37,6 +36,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, MAYBE_GetLastFocusedWindow) {
// Create a new window which making it the "last focused" window.
// Note that "last focused" means the "top" most window.
Browser* new_browser = CreateBrowser(browser()->profile());
+ ui_test_utils::ActivateBrowserWindow(new_browser);
+
+ GURL url("about:blank");
+ AddTabAtIndexToBrowser(new_browser, 0, url, ui::PAGE_TRANSITION_LINK, true);
Qiang(Joe) Xu 2016/11/15 02:17:22 Add these two lines, otherwise test fails on linux
+
int focused_window_id =
extensions::ExtensionTabUtil::GetWindowId(new_browser);
@@ -75,14 +79,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, QueryLastFocusedWindowTabs) {
CreateBrowser(browser()->profile());
Browser* focused_window = CreateBrowser(browser()->profile());
-#if defined(OS_MACOSX)
- // See BrowserWindowCocoa::Show. In tests, Browser::window()->IsActive won't
- // work unless we fake the browser being launched by the user.
- ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(
- focused_window->window()->GetNativeWindow()));
-#endif
- ui_test_utils::BrowserActivationWaiter waiter(focused_window);
- waiter.WaitForActivation();
+ ui_test_utils::ActivateBrowserWindow(focused_window);
GURL url("about:blank");
AddTabAtIndexToBrowser(focused_window, 0, url, ui::PAGE_TRANSITION_LINK,
@@ -135,5 +132,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, QueryLastFocusedWindowTabs) {
#define MAYBE_TabCurrentWindow TabCurrentWindow
#endif
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_TabCurrentWindow) {
+ ui_test_utils::ActivateBrowserWindow(browser());
ASSERT_TRUE(RunExtensionTest("tabs/current_window")) << message_;
}
+
+} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/ui/browser_focus_uitest.cc » ('j') | chrome/test/base/interactive_test_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698