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

Unified Diff: chrome/browser/ui/webui/options/language_options_interactive_uitest.cc

Issue 503863002: Address flaky test by waiting for focus change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/ui/webui/options/language_options_interactive_uitest.cc
diff --git a/chrome/browser/ui/webui/options/language_options_interactive_uitest.cc b/chrome/browser/ui/webui/options/language_options_interactive_uitest.cc
index 325e9e9ddea68a88f528cf6a28cec717c344b4e8..576e6b529cd3873d52304d7e38dc4c132ca0e960 100644
--- a/chrome/browser/ui/webui/options/language_options_interactive_uitest.cc
+++ b/chrome/browser/ui/webui/options/language_options_interactive_uitest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/prefs/pref_service.h"
+#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -60,14 +61,26 @@ class LanguageOptionsWebUITest : public InProcessBrowserTest {
return GetActiveWebContents()->GetFocusedFrame();
}
+ content::RenderViewHost* GetRenderViewHost() {
msw 2014/08/27 19:01:33 nit: this helper seem unnecessary for one call.
+ return GetActiveWebContents()->GetRenderViewHost();
+ }
+
content::WebContents* GetActiveWebContents() {
return browser()->tab_strip_model()->GetActiveWebContents();
}
- // Press and release a key in a particular window. Returns false on error.
+ // Press and release a key in the browser. This will wait for the element on
+ // the page to change.
bool PressKey(ui::KeyboardCode key_code) {
- return ui_test_utils::SendKeyPressSync(browser(), key_code,
- false, false, false, false);
+ return ui_test_utils::SendKeyPressAndWait(
+ browser(),
+ key_code,
+ false,
+ false,
+ false,
+ false,
+ content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
+ content::Source<content::RenderViewHost>(GetRenderViewHost()));
}
private:
@@ -116,8 +129,7 @@ IN_PROC_BROWSER_TEST_F(LanguageOptionsWebUITest, TestAvailableLanguages) {
// This test must be updated if the tab order of the elements on this page
// is chagned.
// flaky: http://crbug.com/405711
-IN_PROC_BROWSER_TEST_F(LanguageOptionsWebUITest,
- DISABLED_TestListTabAccessibility) {
+IN_PROC_BROWSER_TEST_F(LanguageOptionsWebUITest, TestListTabAccessibility) {
// Verify that the language list is focused by default.
std::string original_id = GetActiveElementId();
EXPECT_EQ("language-options-list", original_id);
« 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