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

Side by Side Diff: chrome/browser/extensions/extension_prefs_unittest.cc

Issue 11027070: Moved JsonPrefStore to use SequencedWorkerPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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) 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 #include "extension_prefs_unittest.h" 5 #include "extension_prefs_unittest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/prefs/public/pref_change_registrar.h" 9 #include "base/prefs/public/pref_change_registrar.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 namespace extensions { 46 namespace extensions {
47 47
48 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { 48 static void AddPattern(URLPatternSet* extent, const std::string& pattern) {
49 int schemes = URLPattern::SCHEME_ALL; 49 int schemes = URLPattern::SCHEME_ALL;
50 extent->AddPattern(URLPattern(schemes, pattern)); 50 extent->AddPattern(URLPattern(schemes, pattern));
51 } 51 }
52 52
53 ExtensionPrefsTest::ExtensionPrefsTest() 53 ExtensionPrefsTest::ExtensionPrefsTest()
54 : ui_thread_(BrowserThread::UI, &message_loop_), 54 : ui_thread_(BrowserThread::UI, &message_loop_),
55 file_thread_(BrowserThread::FILE, &message_loop_) { 55 prefs_(message_loop_.message_loop_proxy()) {
56 } 56 }
57 57
58 ExtensionPrefsTest::~ExtensionPrefsTest() {} 58 ExtensionPrefsTest::~ExtensionPrefsTest() {
59 }
59 60
60 void ExtensionPrefsTest::RegisterPreferences() {} 61 void ExtensionPrefsTest::RegisterPreferences() {}
61 62
62 void ExtensionPrefsTest::SetUp() { 63 void ExtensionPrefsTest::SetUp() {
63 RegisterPreferences(); 64 RegisterPreferences();
64 Initialize(); 65 Initialize();
65 } 66 }
66 67
67 void ExtensionPrefsTest::TearDown() { 68 void ExtensionPrefsTest::TearDown() {
68 Verify(); 69 Verify();
69 70
70 // Reset ExtensionPrefs, and re-verify. 71 // Reset ExtensionPrefs, and re-verify.
71 prefs_.RecreateExtensionPrefs(); 72 prefs_.RecreateExtensionPrefs();
72 RegisterPreferences(); 73 RegisterPreferences();
73 Verify(); 74 Verify();
75 prefs_.pref_service()->CommitPendingWrite();
76 message_loop_.RunAllPending();
74 } 77 }
75 78
76 // Tests the LastPingDay/SetLastPingDay functions. 79 // Tests the LastPingDay/SetLastPingDay functions.
77 class ExtensionPrefsLastPingDay : public ExtensionPrefsTest { 80 class ExtensionPrefsLastPingDay : public ExtensionPrefsTest {
78 public: 81 public:
79 ExtensionPrefsLastPingDay() 82 ExtensionPrefsLastPingDay()
80 : extension_time_(Time::Now() - TimeDelta::FromHours(4)), 83 : extension_time_(Time::Now() - TimeDelta::FromHours(4)),
81 blacklist_time_(Time::Now() - TimeDelta::FromHours(2)) {} 84 blacklist_time_(Time::Now() - TimeDelta::FromHours(2)) {}
82 85
83 virtual void Initialize() { 86 virtual void Initialize() {
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 EXPECT_EQ(string16(), error16); 1285 EXPECT_EQ(string16(), error16);
1283 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); 1286 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16));
1284 EXPECT_EQ(string16(), error16); 1287 EXPECT_EQ(string16(), error16);
1285 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); 1288 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16));
1286 EXPECT_EQ(string16(), error16); 1289 EXPECT_EQ(string16(), error16);
1287 } 1290 }
1288 }; 1291 };
1289 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} 1292 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {}
1290 1293
1291 } // namespace extensions 1294 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698