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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" | 9 #include "chrome/browser/browsing_data/browsing_data_remover_test_util.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, | 82 IN_PROC_BROWSER_TEST_F(ClearBrowserDataBrowserTest, |
83 CommitButtonDisabledWhenNoDataTypesSelected) { | 83 CommitButtonDisabledWhenNoDataTypesSelected) { |
84 const char kCommitButtonId[] = "#clear-browser-data-commit"; | 84 const char kCommitButtonId[] = "#clear-browser-data-commit"; |
85 const char* kDataTypes[] = {"browser.clear_data.browsing_history", | 85 const char* kDataTypes[] = {"browser.clear_data.browsing_history", |
86 "browser.clear_data.download_history", | 86 "browser.clear_data.download_history", |
87 "browser.clear_data.cache", | 87 "browser.clear_data.cache", |
88 "browser.clear_data.cookies", | 88 "browser.clear_data.cookies", |
89 "browser.clear_data.passwords", | 89 "browser.clear_data.passwords", |
90 "browser.clear_data.form_data", | 90 "browser.clear_data.form_data", |
91 "browser.clear_data.hosted_apps_data", | 91 "browser.clear_data.hosted_apps_data", |
92 "browser.clear_data.content_licenses"}; | 92 "browser.clear_data.media_licenses"}; |
93 | 93 |
94 PrefService* prefs = browser()->profile()->GetPrefs(); | 94 PrefService* prefs = browser()->profile()->GetPrefs(); |
95 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { | 95 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { |
96 prefs->SetBoolean(kDataTypes[i], false); | 96 prefs->SetBoolean(kDataTypes[i], false); |
97 } | 97 } |
98 | 98 |
99 // Navigate to the Clear Browsing Data dialog to ensure that the commit button | 99 // Navigate to the Clear Browsing Data dialog to ensure that the commit button |
100 // is disabled if clearing is not requested for any of the data types. | 100 // is disabled if clearing is not requested for any of the data types. |
101 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); | 101 NavigateToSettingsSubpage(chrome::kClearBrowserDataSubPage); |
102 EXPECT_FALSE(IsElementEnabled(kCommitButtonId)); | 102 EXPECT_FALSE(IsElementEnabled(kCommitButtonId)); |
103 | 103 |
104 // 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 |
105 // gets selected to be cleared. | 105 // gets selected to be cleared. |
106 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { | 106 for (size_t i = 0; i < arraysize(kDataTypes); ++i) { |
107 prefs->SetBoolean(kDataTypes[i], true); | 107 prefs->SetBoolean(kDataTypes[i], true); |
108 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); | 108 EXPECT_TRUE(IsElementEnabled(kCommitButtonId)); |
109 prefs->SetBoolean(kDataTypes[i], false); | 109 prefs->SetBoolean(kDataTypes[i], false); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 } // namespace options | 113 } // namespace options |
OLD | NEW |