| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/prefs/public/pref_change_registrar.h" | 13 #include "base/prefs/public/pref_change_registrar.h" |
| 14 #include "base/prefs/public/pref_observer.h" | |
| 15 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 14 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
| 16 #include "chrome/browser/policy/policy_types.h" | 15 #include "chrome/browser/policy/policy_types.h" |
| 17 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
| 18 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
| 19 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 21 | 20 |
| 22 namespace base { | 21 namespace base { |
| 23 class DictionaryValue; | 22 class DictionaryValue; |
| 24 class Value; | 23 class Value; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| 28 class NotificationDetails; | 27 class NotificationDetails; |
| 29 class NotificationSource; | 28 class NotificationSource; |
| 30 class RenderViewHost; | 29 class RenderViewHost; |
| 31 } | 30 } |
| 32 | 31 |
| 33 // Tests verifying that the JavaScript Preferences class, the underlying C++ | 32 // Tests verifying that the JavaScript Preferences class, the underlying C++ |
| 34 // CoreOptionsHandler and the specialized classes handling Chrome OS device and | 33 // CoreOptionsHandler and the specialized classes handling Chrome OS device and |
| 35 // proxy prefs behave correctly. | 34 // proxy prefs behave correctly. |
| 36 class PreferencesBrowserTest : public InProcessBrowserTest, | 35 class PreferencesBrowserTest : public InProcessBrowserTest { |
| 37 public PrefObserver { | |
| 38 public: | 36 public: |
| 39 PreferencesBrowserTest(); | 37 PreferencesBrowserTest(); |
| 40 ~PreferencesBrowserTest(); | 38 ~PreferencesBrowserTest(); |
| 41 | 39 |
| 42 // InProcessBrowserTest implementation: | 40 // InProcessBrowserTest implementation: |
| 43 virtual void SetUpOnMainThread() OVERRIDE; | 41 virtual void SetUpOnMainThread() OVERRIDE; |
| 44 | 42 |
| 45 // PrefObserver implementation: | 43 void OnPreferenceChanged(const std::string& pref_name); |
| 46 virtual void OnPreferenceChanged(PrefServiceBase* service, | |
| 47 const std::string& pref_name) OVERRIDE; | |
| 48 | 44 |
| 49 protected: | 45 protected: |
| 50 MOCK_METHOD1(OnCommit, void(const PrefService::Preference*)); | 46 MOCK_METHOD1(OnCommit, void(const PrefService::Preference*)); |
| 51 | 47 |
| 52 // InProcessBrowserTest implementation: | 48 // InProcessBrowserTest implementation: |
| 53 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 49 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
| 54 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE; | 50 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE; |
| 55 | 51 |
| 56 // Sets user policies through the mock policy provider. | 52 // Sets user policies through the mock policy provider. |
| 57 void SetUserPolicies(const std::vector<std::string>& names, | 53 void SetUserPolicies(const std::vector<std::string>& names, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 std::vector<std::string> pref_names_; | 175 std::vector<std::string> pref_names_; |
| 180 std::vector<std::string> policy_names_; | 176 std::vector<std::string> policy_names_; |
| 181 std::vector<base::Value*> default_values_; | 177 std::vector<base::Value*> default_values_; |
| 182 std::vector<base::Value*> non_default_values_; | 178 std::vector<base::Value*> non_default_values_; |
| 183 | 179 |
| 184 private: | 180 private: |
| 185 DISALLOW_COPY_AND_ASSIGN(PreferencesBrowserTest); | 181 DISALLOW_COPY_AND_ASSIGN(PreferencesBrowserTest); |
| 186 }; | 182 }; |
| 187 | 183 |
| 188 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_ | 184 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PREFERENCES_BROWSERTEST_H_ |
| OLD | NEW |