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

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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 namespace extensions { 47 namespace extensions {
48 48
49 static void AddPattern(URLPatternSet* extent, const std::string& pattern) { 49 static void AddPattern(URLPatternSet* extent, const std::string& pattern) {
50 int schemes = URLPattern::SCHEME_ALL; 50 int schemes = URLPattern::SCHEME_ALL;
51 extent->AddPattern(URLPattern(schemes, pattern)); 51 extent->AddPattern(URLPattern(schemes, pattern));
52 } 52 }
53 53
54 ExtensionPrefsTest::ExtensionPrefsTest() 54 ExtensionPrefsTest::ExtensionPrefsTest()
55 : ui_thread_(BrowserThread::UI, &message_loop_), 55 : ui_thread_(BrowserThread::UI, &message_loop_),
56 file_thread_(BrowserThread::FILE, &message_loop_) { 56 prefs_(message_loop_.message_loop_proxy()) {
57 } 57 }
58 58
59 ExtensionPrefsTest::~ExtensionPrefsTest() {} 59 ExtensionPrefsTest::~ExtensionPrefsTest() {
60 }
60 61
61 void ExtensionPrefsTest::RegisterPreferences() {} 62 void ExtensionPrefsTest::RegisterPreferences() {}
62 63
63 void ExtensionPrefsTest::SetUp() { 64 void ExtensionPrefsTest::SetUp() {
64 RegisterPreferences(); 65 RegisterPreferences();
65 Initialize(); 66 Initialize();
66 } 67 }
67 68
68 void ExtensionPrefsTest::TearDown() { 69 void ExtensionPrefsTest::TearDown() {
69 Verify(); 70 Verify();
70 71
71 // Reset ExtensionPrefs, and re-verify. 72 // Reset ExtensionPrefs, and re-verify.
72 prefs_.RecreateExtensionPrefs(); 73 prefs_.RecreateExtensionPrefs();
73 RegisterPreferences(); 74 RegisterPreferences();
74 Verify(); 75 Verify();
76 prefs_.pref_service()->CommitPendingWrite();
77 message_loop_.RunUntilIdle();
75 } 78 }
76 79
77 // Tests the LastPingDay/SetLastPingDay functions. 80 // Tests the LastPingDay/SetLastPingDay functions.
78 class ExtensionPrefsLastPingDay : public ExtensionPrefsTest { 81 class ExtensionPrefsLastPingDay : public ExtensionPrefsTest {
79 public: 82 public:
80 ExtensionPrefsLastPingDay() 83 ExtensionPrefsLastPingDay()
81 : extension_time_(Time::Now() - TimeDelta::FromHours(4)), 84 : extension_time_(Time::Now() - TimeDelta::FromHours(4)),
82 blacklist_time_(Time::Now() - TimeDelta::FromHours(2)) {} 85 blacklist_time_(Time::Now() - TimeDelta::FromHours(2)) {}
83 86
84 virtual void Initialize() { 87 virtual void Initialize() {
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 EXPECT_EQ(string16(), error16); 1304 EXPECT_EQ(string16(), error16);
1302 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); 1305 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16));
1303 EXPECT_EQ(string16(), error16); 1306 EXPECT_EQ(string16(), error16);
1304 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); 1307 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16));
1305 EXPECT_EQ(string16(), error16); 1308 EXPECT_EQ(string16(), error16);
1306 } 1309 }
1307 }; 1310 };
1308 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} 1311 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {}
1309 1312
1310 } // namespace extensions 1313 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698