| 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 23 matching lines...) Expand all Loading... |
| 34 const std::string& selector, | 34 const std::string& selector, |
| 35 bool* enabled) { | 35 bool* enabled) { |
| 36 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 36 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
| 37 GetSettingsFrame(), | 37 GetSettingsFrame(), |
| 38 "window.domAutomationController.send(!document.querySelector('" + | 38 "window.domAutomationController.send(!document.querySelector('" + |
| 39 selector + "').disabled);", | 39 selector + "').disabled);", |
| 40 enabled)); | 40 enabled)); |
| 41 } | 41 } |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // http://crbug.com/458684 |
| 45 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 46 #define MAYBE_CommitButtonDisabledWhileDeletionInProgress \ |
| 47 DISABLED_CommitButtonDisabledWhileDeletionInProgress |
| 48 #else |
| 49 #define MAYBE_CommitButtonDisabledWhileDeletionInProgress \ |
| 50 CommitButtonDisabledWhileDeletionInProgress |
| 51 #endif |
| 52 |
| 44 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, | 53 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, |
| 45 CommitButtonDisabledWhileDeletionInProgress) { | 54 MAYBE_CommitButtonDisabledWhileDeletionInProgress) { |
| 46 const char kCommitButtonId[] = "#clear-browser-data-commit"; | 55 const char kCommitButtonId[] = "#clear-browser-data-commit"; |
| 47 BrowsingDataRemoverCompletionInhibitor completion_inhibitor; | 56 BrowsingDataRemoverCompletionInhibitor completion_inhibitor; |
| 48 | 57 |
| 49 // Navigate to the Clear Browsing Data dialog to ensure that the commit button | 58 // Navigate to the Clear Browsing Data dialog to ensure that the commit button |
| 50 // is initially enabled, usable, and gets disabled after having been pressed. | 59 // is initially enabled, usable, and gets disabled after having been pressed. |
| 51 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); | 60 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); |
| 52 ASSERT_NO_FATAL_FAILURE(ClickElement(kCommitButtonId)); | 61 ASSERT_NO_FATAL_FAILURE(ClickElement(kCommitButtonId)); |
| 53 EXPECT_FALSE(IsElementEnabled(kCommitButtonId)); | 62 EXPECT_FALSE(IsElementEnabled(kCommitButtonId)); |
| 54 | 63 |
| 55 completion_inhibitor.BlockUntilNearCompletion(); | 64 completion_inhibitor.BlockUntilNearCompletion(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // However, expect the commit button to be re-enabled if any of the data types | 100 // However, expect the commit button to be re-enabled if any of the data types |
| 92 // gets selected to be cleared. | 101 // gets selected to be cleared. |
| 93 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { | 102 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { |
| 94 prefs->SetBoolean(kDataTypes[i], true); | 103 prefs->SetBoolean(kDataTypes[i], true); |
| 95 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); | 104 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); |
| 96 prefs->SetBoolean(kDataTypes[i], false); | 105 prefs->SetBoolean(kDataTypes[i], false); |
| 97 } | 106 } |
| 98 } | 107 } |
| 99 | 108 |
| 100 } // namespace options | 109 } // namespace options |
| OLD | NEW |