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

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: fixes for LoginUtils* test flakes 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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 EXPECT_EQ(string16(), error16); 1286 EXPECT_EQ(string16(), error16);
1284 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); 1287 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16));
1285 EXPECT_EQ(string16(), error16); 1288 EXPECT_EQ(string16(), error16);
1286 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); 1289 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16));
1287 EXPECT_EQ(string16(), error16); 1290 EXPECT_EQ(string16(), error16);
1288 } 1291 }
1289 }; 1292 };
1290 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} 1293 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {}
1291 1294
1292 } // namespace extensions 1295 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698