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

Side by Side Diff: chrome/browser/ui/webui/options/clear_browser_data_browsertest.cc

Issue 302293002: Fix ClearBrowserDataBrowserTest.CommitButtonDisabledWhileDeletionInProgress flake. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_ui_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/prefs/pref_service.h" 5 #include "base/prefs/pref_service.h"
6 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" 6 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" 9 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const std::string& selector, 44 const std::string& selector,
45 bool* enabled) { 45 bool* enabled) {
46 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 46 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
47 GetSettingsFrame(), 47 GetSettingsFrame(),
48 "window.domAutomationController.send(!document.querySelector('" + 48 "window.domAutomationController.send(!document.querySelector('" +
49 selector + "').disabled);", 49 selector + "').disabled);",
50 enabled)); 50 enabled));
51 } 51 }
52 }; 52 };
53 53
54 // Fails flakily. http://crbug.com/379574
55 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, 54 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest,
56 DISABLED_CommitButtonDisabledWhileDeletionInProgress) { 55 CommitButtonDisabledWhileDeletionInProgress) {
57 const char kTimePeriodSelectorId[] = "#clear-browser-data-time-period"; 56 const char kTimePeriodSelectorId[] = "#clear-browser-data-time-period";
58 const char kCommitButtonId[] = "#clear-browser-data-commit"; 57 const char kCommitButtonId[] = "#clear-browser-data-commit";
59 BrowsingDataRemoverCompletionInhibitor completion_inhibitor; 58 BrowsingDataRemoverCompletionInhibitor completion_inhibitor;
60 59
61 // Navigate to the Clear Browsing Data dialog to ensure that the commit button 60 // Navigate to the Clear Browsing Data dialog to ensure that the commit button
62 // is initially enabled, usable, and gets disabled after having been pressed. 61 // is initially enabled, usable, and gets disabled after having been pressed.
63 // Furthermore, verify that the time period combo-box gets the initial focus. 62 // Furthermore, verify that the time period combo-box gets the initial focus.
64 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); 63 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage);
65 EXPECT_TRUE(IsElementInFocus(kTimePeriodSelectorId)); 64 EXPECT_TRUE(IsElementInFocus(kTimePeriodSelectorId));
66 ASSERT_NO_FATAL_FAILURE(ClickElement(kCommitButtonId)); 65 ASSERT_NO_FATAL_FAILURE(ClickElement(kCommitButtonId));
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // However, expect the commit button to be re-enabled if any of the data types 104 // However, expect the commit button to be re-enabled if any of the data types
106 // gets selected to be cleared. 105 // gets selected to be cleared.
107 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { 106 for (size_t i = 0; i < arraysize(kDataTypes); ++i) {
108 prefs->SetBoolean(kDataTypes[i], true); 107 prefs->SetBoolean(kDataTypes[i], true);
109 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); 108 EXPECT_TRUE(IsElementEnabled(kCommitButtonId));
110 prefs->SetBoolean(kDataTypes[i], false); 109 prefs->SetBoolean(kDataTypes[i], false);
111 } 110 }
112 } 111 }
113 112
114 } // namespace options 113 } // namespace options
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698