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

Unified Diff: chrome/browser/blocked_popup_container_interactive_uitest.cc

Issue 259010: For some reason, if the interactive test that I added runs after inprocess te... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/blocked_popup_container_interactive_uitest.cc
===================================================================
--- chrome/browser/blocked_popup_container_interactive_uitest.cc (revision 27822)
+++ chrome/browser/blocked_popup_container_interactive_uitest.cc (working copy)
@@ -7,6 +7,7 @@
#include "app/l10n_util.h"
#include "base/file_path.h"
#include "base/gfx/rect.h"
+#include "base/keyboard_codes.h"
#include "chrome/browser/view_ids.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/test/automation/automation_constants.h"
@@ -249,3 +250,39 @@
// We popup shouldn't be closed by the onblur handler.
ASSERT_FALSE(automation()->WaitForWindowCountToBecome(1, 1500));
}
+
+#if !defined(OS_MACOSX) // see BrowserWindowCocoa::GetCommandId
+// Tests that tab related keyboard accelerators are reserved by the app.
+
+class BrowserInteractiveTest : public UITest {
+};
+
+TEST_F(BrowserInteractiveTest, ReserveKeyboardAccelerators) {
+ const std::string kBadPage =
+ "<html><script>"
+ "document.onkeydown = function() {"
+ " event.preventDefault();"
+ " return false;"
+ "}"
+ "</script></html>";
+ scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ browser->AppendTab(GURL("data:text/html," + kBadPage));
+ int tab_count = 0;
+ ASSERT_TRUE(browser->GetTabCount(&tab_count));
+ ASSERT_EQ(tab_count, 2);
+
+ int active_tab = 0;
+ ASSERT_TRUE(browser->GetActiveTabIndex(&active_tab));
+ ASSERT_EQ(active_tab, 1);
+
+ scoped_refptr<WindowProxy> window(browser->GetWindow());
+ ASSERT_TRUE(window->SimulateOSKeyPress(
+ base::VKEY_TAB, views::Event::EF_CONTROL_DOWN));
+ ASSERT_TRUE(browser->WaitForTabToBecomeActive(0, action_max_timeout_ms()));
+
+ ASSERT_TRUE(browser->ActivateTab(1));
+ ASSERT_TRUE(window->SimulateOSKeyPress(
+ base::VKEY_W, views::Event::EF_CONTROL_DOWN));
+ ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_max_timeout_ms()));
+}
+#endif
« no previous file with comments | « no previous file | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698