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

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: rebase 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/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.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 file_thread_(BrowserThread::FILE, &message_loop_),
Mattias Nissler (ping if slow) 2012/10/22 17:28:21 Have you verified that we still need the mock file
zel 2012/10/24 02:20:11 message_loop_.message_loop_proxy() parameter here
Mattias Nissler (ping if slow) 2012/10/24 13:36:16 I understand that, but is the local file_thread_ i
zel 2012/10/24 16:49:48 Yes. Removed.
56 prefs_(message_loop_.message_loop_proxy()) {
56 } 57 }
57 58
58 ExtensionPrefsTest::~ExtensionPrefsTest() {} 59 ExtensionPrefsTest::~ExtensionPrefsTest() {
60 }
59 61
60 void ExtensionPrefsTest::RegisterPreferences() {} 62 void ExtensionPrefsTest::RegisterPreferences() {}
61 63
62 void ExtensionPrefsTest::SetUp() { 64 void ExtensionPrefsTest::SetUp() {
63 RegisterPreferences(); 65 RegisterPreferences();
64 Initialize(); 66 Initialize();
65 } 67 }
66 68
67 void ExtensionPrefsTest::TearDown() { 69 void ExtensionPrefsTest::TearDown() {
68 Verify(); 70 Verify();
69 71
70 // Reset ExtensionPrefs, and re-verify. 72 // Reset ExtensionPrefs, and re-verify.
71 prefs_.RecreateExtensionPrefs(); 73 prefs_.RecreateExtensionPrefs();
72 RegisterPreferences(); 74 RegisterPreferences();
73 Verify(); 75 Verify();
76 prefs_.pref_service()->CommitPendingWrite();
77 message_loop_.RunAllPending();
Mattias Nissler (ping if slow) 2012/10/22 17:28:21 Why are these two needed? Could use a comment.
74 } 78 }
75 79
76 // Tests the LastPingDay/SetLastPingDay functions. 80 // Tests the LastPingDay/SetLastPingDay functions.
77 class ExtensionPrefsLastPingDay : public ExtensionPrefsTest { 81 class ExtensionPrefsLastPingDay : public ExtensionPrefsTest {
78 public: 82 public:
79 ExtensionPrefsLastPingDay() 83 ExtensionPrefsLastPingDay()
80 : extension_time_(Time::Now() - TimeDelta::FromHours(4)), 84 : extension_time_(Time::Now() - TimeDelta::FromHours(4)),
81 blacklist_time_(Time::Now() - TimeDelta::FromHours(2)) {} 85 blacklist_time_(Time::Now() - TimeDelta::FromHours(2)) {}
82 86
83 virtual void Initialize() { 87 virtual void Initialize() {
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 EXPECT_EQ(string16(), error16); 1286 EXPECT_EQ(string16(), error16);
1283 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16)); 1287 EXPECT_TRUE(prefs()->UserMayModifySettings(extension_.get(), &error16));
1284 EXPECT_EQ(string16(), error16); 1288 EXPECT_EQ(string16(), error16);
1285 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16)); 1289 EXPECT_FALSE(prefs()->MustRemainEnabled(extension_.get(), &error16));
1286 EXPECT_EQ(string16(), error16); 1290 EXPECT_EQ(string16(), error16);
1287 } 1291 }
1288 }; 1292 };
1289 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {} 1293 TEST_F(ExtensionPrefsNotRequiredExtension, NotRequiredExtension) {}
1290 1294
1291 } // namespace extensions 1295 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698