| 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 |
| 54 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, | 55 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, |
| 55 CommitButtonDisabledWhileDeletionInProgress) { | 56 DISABLED_CommitButtonDisabledWhileDeletionInProgress) { |
| 56 const char kTimePeriodSelectorId[] = "#clear-browser-data-time-period"; | 57 const char kTimePeriodSelectorId[] = "#clear-browser-data-time-period"; |
| 57 const char kCommitButtonId[] = "#clear-browser-data-commit"; | 58 const char kCommitButtonId[] = "#clear-browser-data-commit"; |
| 58 BrowsingDataRemoverCompletionInhibitor completion_inhibitor; | 59 BrowsingDataRemoverCompletionInhibitor completion_inhibitor; |
| 59 | 60 |
| 60 // Navigate to the Clear Browsing Data dialog to ensure that the commit button | 61 // Navigate to the Clear Browsing Data dialog to ensure that the commit button |
| 61 // is initially enabled, usable, and gets disabled after having been pressed. | 62 // is initially enabled, usable, and gets disabled after having been pressed. |
| 62 // Furthermore, verify that the time period combo-box gets the initial focus. | 63 // Furthermore, verify that the time period combo-box gets the initial focus. |
| 63 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); | 64 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); |
| 64 EXPECT_TRUE(IsElementInFocus(kTimePeriodSelectorId)); | 65 EXPECT_TRUE(IsElementInFocus(kTimePeriodSelectorId)); |
| 65 ASSERT_NO_FATAL_FAILURE(ClickElement(kCommitButtonId)); | 66 ASSERT_NO_FATAL_FAILURE(ClickElement(kCommitButtonId)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // However, expect the commit button to be re-enabled if any of the data types | 105 // However, expect the commit button to be re-enabled if any of the data types |
| 105 // gets selected to be cleared. | 106 // gets selected to be cleared. |
| 106 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { | 107 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { |
| 107 prefs->SetBoolean(kDataTypes[i], true); | 108 prefs->SetBoolean(kDataTypes[i], true); |
| 108 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); | 109 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); |
| 109 prefs->SetBoolean(kDataTypes[i], false); | 110 prefs->SetBoolean(kDataTypes[i], false); |
| 110 } | 111 } |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace options | 114 } // namespace options |
| OLD | NEW |