| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" |
| 6 #include "chrome/browser/content_settings/content_settings_details.h" |
| 5 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 7 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
| 6 | |
| 7 #include "base/message_loop.h" | |
| 8 #include "chrome/browser/browser_thread.h" | |
| 9 #include "chrome/browser/content_settings/content_settings_details.h" | |
| 10 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/common/notification_registrar.h" | 9 #include "chrome/common/notification_registrar.h" |
| 12 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
| 13 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/test/testing_profile.h" | 12 #include "chrome/test/testing_profile.h" |
| 13 #include "content/browser/browser_thread.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 15 |
| 17 | 16 |
| 18 namespace { | 17 namespace { |
| 19 | 18 |
| 20 class StubSettingsObserver : public NotificationObserver { | 19 class StubSettingsObserver : public NotificationObserver { |
| 21 public: | 20 public: |
| 22 StubSettingsObserver() : last_notifier(NULL), counter(0) { | 21 StubSettingsObserver() : last_notifier(NULL), counter(0) { |
| 23 registrar_.Add(this, NotificationType::GEOLOCATION_SETTINGS_CHANGED, | 22 registrar_.Add(this, NotificationType::GEOLOCATION_SETTINGS_CHANGED, |
| 24 NotificationService::AllSources()); | 23 NotificationService::AllSources()); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 PrefService* prefs = profile.GetPrefs(); | 300 PrefService* prefs = profile.GetPrefs(); |
| 302 prefs->SetInteger(prefs::kGeolocationDefaultContentSetting, | 301 prefs->SetInteger(prefs::kGeolocationDefaultContentSetting, |
| 303 CONTENT_SETTING_ALLOW); | 302 CONTENT_SETTING_ALLOW); |
| 304 EXPECT_EQ(2, observer.counter); | 303 EXPECT_EQ(2, observer.counter); |
| 305 EXPECT_EQ(map, observer.last_notifier); | 304 EXPECT_EQ(map, observer.last_notifier); |
| 306 EXPECT_EQ(CONTENT_SETTINGS_TYPE_DEFAULT, observer.last_type); | 305 EXPECT_EQ(CONTENT_SETTINGS_TYPE_DEFAULT, observer.last_type); |
| 307 EXPECT_EQ(CONTENT_SETTING_ALLOW, map->GetDefaultContentSetting()); | 306 EXPECT_EQ(CONTENT_SETTING_ALLOW, map->GetDefaultContentSetting()); |
| 308 } | 307 } |
| 309 | 308 |
| 310 } // namespace | 309 } // namespace |
| OLD | NEW |