OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |