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

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

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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" 5 #include "base/message_loop.h"
6 #include "chrome/browser/content_settings/content_settings_details.h" 6 #include "chrome/browser/content_settings/content_settings_details.h"
7 #include "chrome/browser/content_settings/host_content_settings_map.h" 7 #include "chrome/browser/content_settings/host_content_settings_map.h"
8 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 8 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/prefs/scoped_user_pref_update.h" 10 #include "chrome/browser/prefs/scoped_user_pref_update.h"
11 #include "chrome/common/chrome_notification_types.h" 11 #include "chrome/common/chrome_notification_types.h"
12 #include "chrome/common/pref_names.h" 12 #include "chrome/common/pref_names.h"
13 #include "chrome/test/base/testing_profile.h" 13 #include "chrome/test/base/testing_profile.h"
14 #include "chrome/test/testing_browser_process_test.h"
14 #include "content/browser/browser_thread.h" 15 #include "content/browser/browser_thread.h"
15 #include "content/common/notification_registrar.h" 16 #include "content/common/notification_registrar.h"
16 #include "content/common/notification_service.h" 17 #include "content/common/notification_service.h"
17 #include "testing/gmock/include/gmock/gmock.h" 18 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 20
20 using ::testing::_; 21 using ::testing::_;
21 22
22 namespace { 23 namespace {
23 24
(...skipping 28 matching lines...) Expand all
52 Details<ContentSettingsDetails>(details).ptr(); 53 Details<ContentSettingsDetails>(details).ptr();
53 OnContentSettingsChanged(map, 54 OnContentSettingsChanged(map,
54 settings_details->type()); 55 settings_details->type());
55 // This checks that calling a Get function from an observer doesn't 56 // This checks that calling a Get function from an observer doesn't
56 // deadlock. 57 // deadlock.
57 // TODO(bauerb): Move into expectation setup. 58 // TODO(bauerb): Move into expectation setup.
58 map->GetContentSetting(GURL("http://random-hostname.com/"), 59 map->GetContentSetting(GURL("http://random-hostname.com/"),
59 GURL("http://foo.random-hostname.com/")); 60 GURL("http://foo.random-hostname.com/"));
60 } 61 }
61 62
62 class GeolocationContentSettingsMapTests : public testing::Test { 63 class GeolocationContentSettingsMapTests : public TestingBrowserProcessTest {
63 public: 64 public:
64 GeolocationContentSettingsMapTests() 65 GeolocationContentSettingsMapTests()
65 : ui_thread_(BrowserThread::UI, &message_loop_) { 66 : ui_thread_(BrowserThread::UI, &message_loop_) {
66 } 67 }
67 68
68 protected: 69 protected:
69 MessageLoop message_loop_; 70 MessageLoop message_loop_;
70 BrowserThread ui_thread_; 71 BrowserThread ui_thread_;
71 }; 72 };
72 73
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 OnContentSettingsChanged(map, CONTENT_SETTINGS_TYPE_DEFAULT)); 309 OnContentSettingsChanged(map, CONTENT_SETTINGS_TYPE_DEFAULT));
309 prefs->SetInteger(prefs::kGeolocationDefaultContentSetting, 310 prefs->SetInteger(prefs::kGeolocationDefaultContentSetting,
310 CONTENT_SETTING_ALLOW); 311 CONTENT_SETTING_ALLOW);
311 312
312 EXPECT_EQ(CONTENT_SETTING_ALLOW, 313 EXPECT_EQ(CONTENT_SETTING_ALLOW,
313 profile.GetHostContentSettingsMap()->GetDefaultContentSetting( 314 profile.GetHostContentSettingsMap()->GetDefaultContentSetting(
314 CONTENT_SETTINGS_TYPE_GEOLOCATION)); 315 CONTENT_SETTINGS_TYPE_GEOLOCATION));
315 } 316 }
316 317
317 } // namespace 318 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698