Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/geolocation/geolocation_content_settings_map_unittest.cc

Issue 6597044: Revert 76228 - Move core pieces of geolocation from chrome to content.This is... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/geolocation/geolocation_content_settings_map.h"
6
5 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/browser_thread.h"
6 #include "chrome/browser/content_settings/content_settings_details.h" 9 #include "chrome/browser/content_settings/content_settings_details.h"
7 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
8 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/common/notification_registrar.h" 11 #include "chrome/common/notification_registrar.h"
10 #include "chrome/common/notification_service.h" 12 #include "chrome/common/notification_service.h"
11 #include "chrome/common/pref_names.h" 13 #include "chrome/common/pref_names.h"
12 #include "chrome/test/testing_profile.h" 14 #include "chrome/test/testing_profile.h"
13 #include "content/browser/browser_thread.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 17
17 namespace { 18 namespace {
18 19
19 class StubSettingsObserver : public NotificationObserver { 20 class StubSettingsObserver : public NotificationObserver {
20 public: 21 public:
21 StubSettingsObserver() : last_notifier(NULL), counter(0) { 22 StubSettingsObserver() : last_notifier(NULL), counter(0) {
22 registrar_.Add(this, NotificationType::GEOLOCATION_SETTINGS_CHANGED, 23 registrar_.Add(this, NotificationType::GEOLOCATION_SETTINGS_CHANGED,
23 NotificationService::AllSources()); 24 NotificationService::AllSources());
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 PrefService* prefs = profile.GetPrefs(); 301 PrefService* prefs = profile.GetPrefs();
301 prefs->SetInteger(prefs::kGeolocationDefaultContentSetting, 302 prefs->SetInteger(prefs::kGeolocationDefaultContentSetting,
302 CONTENT_SETTING_ALLOW); 303 CONTENT_SETTING_ALLOW);
303 EXPECT_EQ(2, observer.counter); 304 EXPECT_EQ(2, observer.counter);
304 EXPECT_EQ(map, observer.last_notifier); 305 EXPECT_EQ(map, observer.last_notifier);
305 EXPECT_EQ(CONTENT_SETTINGS_TYPE_DEFAULT, observer.last_type); 306 EXPECT_EQ(CONTENT_SETTINGS_TYPE_DEFAULT, observer.last_type);
306 EXPECT_EQ(CONTENT_SETTING_ALLOW, map->GetDefaultContentSetting()); 307 EXPECT_EQ(CONTENT_SETTING_ALLOW, map->GetDefaultContentSetting());
307 } 308 }
308 309
309 } // namespace 310 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698