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

Side by Side Diff: chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc

Issue 196663003: Introduce an extension parameter which is used to customize the extension. It's available for exter… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified test parameters Created 6 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h" 5 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic y_loader.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 MockExternalPolicyProviderVisitor(); 63 MockExternalPolicyProviderVisitor();
64 virtual ~MockExternalPolicyProviderVisitor(); 64 virtual ~MockExternalPolicyProviderVisitor();
65 65
66 MOCK_METHOD6(OnExternalExtensionFileFound, 66 MOCK_METHOD6(OnExternalExtensionFileFound,
67 bool(const std::string&, 67 bool(const std::string&,
68 const base::Version*, 68 const base::Version*,
69 const base::FilePath&, 69 const base::FilePath&,
70 extensions::Manifest::Location, 70 extensions::Manifest::Location,
71 int, 71 int,
72 bool)); 72 bool));
73 MOCK_METHOD5(OnExternalExtensionUpdateUrlFound, 73 MOCK_METHOD6(OnExternalExtensionUpdateUrlFound,
74 bool(const std::string&, 74 bool(const std::string&,
75 const std::string&,
75 const GURL&, 76 const GURL&,
76 extensions::Manifest::Location, 77 extensions::Manifest::Location,
77 int, 78 int,
78 bool)); 79 bool));
79 MOCK_METHOD1(OnExternalProviderReady, 80 MOCK_METHOD1(OnExternalProviderReady,
80 void(const extensions::ExternalProviderInterface* provider)); 81 void(const extensions::ExternalProviderInterface* provider));
81 82
82 private: 83 private:
83 DISALLOW_COPY_AND_ASSIGN(MockExternalPolicyProviderVisitor); 84 DISALLOW_COPY_AND_ASSIGN(MockExternalPolicyProviderVisitor);
84 }; 85 };
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 150
150 void DeviceLocalAccountExternalPolicyLoaderTest::TearDown() { 151 void DeviceLocalAccountExternalPolicyLoaderTest::TearDown() {
151 TestingBrowserProcess::GetGlobal()->SetSystemRequestContext(NULL); 152 TestingBrowserProcess::GetGlobal()->SetSystemRequestContext(NULL);
152 } 153 }
153 154
154 void DeviceLocalAccountExternalPolicyLoaderTest:: 155 void DeviceLocalAccountExternalPolicyLoaderTest::
155 VerifyAndResetVisitorCallExpectations() { 156 VerifyAndResetVisitorCallExpectations() {
156 Mock::VerifyAndClearExpectations(&visitor_); 157 Mock::VerifyAndClearExpectations(&visitor_);
157 EXPECT_CALL(visitor_, OnExternalExtensionFileFound(_, _, _, _, _, _)) 158 EXPECT_CALL(visitor_, OnExternalExtensionFileFound(_, _, _, _, _, _))
158 .Times(0); 159 .Times(0);
159 EXPECT_CALL(visitor_, OnExternalExtensionUpdateUrlFound(_, _, _, _, _)) 160 EXPECT_CALL(visitor_, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _))
160 .Times(0); 161 .Times(0);
161 EXPECT_CALL(visitor_, OnExternalProviderReady(_)) 162 EXPECT_CALL(visitor_, OnExternalProviderReady(_))
162 .Times(0); 163 .Times(0);
163 } 164 }
164 165
165 void DeviceLocalAccountExternalPolicyLoaderTest::SetForceInstallListPolicy() { 166 void DeviceLocalAccountExternalPolicyLoaderTest::SetForceInstallListPolicy() {
166 scoped_ptr<base::ListValue> forcelist(new base::ListValue); 167 scoped_ptr<base::ListValue> forcelist(new base::ListValue);
167 forcelist->AppendString("invalid"); 168 forcelist->AppendString("invalid");
168 forcelist->AppendString(base::StringPrintf( 169 forcelist->AppendString(base::StringPrintf(
169 "%s;%s", 170 "%s;%s",
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 loader_->StopCache(shutdown_run_loop.QuitClosure()); 300 loader_->StopCache(shutdown_run_loop.QuitClosure());
300 VerifyAndResetVisitorCallExpectations(); 301 VerifyAndResetVisitorCallExpectations();
301 302
302 // Spin the loop until the cache shutdown callback is invoked. Verify that at 303 // Spin the loop until the cache shutdown callback is invoked. Verify that at
303 // that point, no further file I/O tasks are pending. 304 // that point, no further file I/O tasks are pending.
304 shutdown_run_loop.Run(); 305 shutdown_run_loop.Run();
305 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); 306 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting());
306 } 307 }
307 308
308 } // namespace chromeos 309 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698