OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/customization_document.h" | 5 #include "chrome/browser/chromeos/customization_document.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 public: | 175 public: |
176 MockExternalProviderVisitor() {} | 176 MockExternalProviderVisitor() {} |
177 | 177 |
178 MOCK_METHOD6(OnExternalExtensionFileFound, | 178 MOCK_METHOD6(OnExternalExtensionFileFound, |
179 bool(const std::string&, | 179 bool(const std::string&, |
180 const base::Version*, | 180 const base::Version*, |
181 const base::FilePath&, | 181 const base::FilePath&, |
182 extensions::Manifest::Location, | 182 extensions::Manifest::Location, |
183 int, | 183 int, |
184 bool)); | 184 bool)); |
185 MOCK_METHOD5(OnExternalExtensionUpdateUrlFound, | 185 MOCK_METHOD6(OnExternalExtensionUpdateUrlFound, |
186 bool(const std::string&, | 186 bool(const std::string&, |
| 187 const std::string&, |
187 const GURL&, | 188 const GURL&, |
188 extensions::Manifest::Location, | 189 extensions::Manifest::Location, |
189 int, | 190 int, |
190 bool)); | 191 bool)); |
191 MOCK_METHOD1(OnExternalProviderReady, | 192 MOCK_METHOD1(OnExternalProviderReady, |
192 void(const extensions::ExternalProviderInterface* provider)); | 193 void(const extensions::ExternalProviderInterface* provider)); |
193 }; | 194 }; |
194 | 195 |
195 class ServicesCustomizationDocumentTest : public testing::Test { | 196 class ServicesCustomizationDocumentTest : public testing::Test { |
196 protected: | 197 protected: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 &visitor, | 300 &visitor, |
300 loader, | 301 loader, |
301 profile.get(), | 302 profile.get(), |
302 extensions::Manifest::EXTERNAL_PREF, | 303 extensions::Manifest::EXTERNAL_PREF, |
303 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, | 304 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, |
304 extensions::Extension::FROM_WEBSTORE | | 305 extensions::Extension::FROM_WEBSTORE | |
305 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); | 306 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); |
306 | 307 |
307 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) | 308 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) |
308 .Times(0); | 309 .Times(0); |
309 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _)) | 310 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) |
310 .Times(0); | 311 .Times(0); |
311 EXPECT_CALL(visitor, OnExternalProviderReady(_)) | 312 EXPECT_CALL(visitor, OnExternalProviderReady(_)) |
312 .Times(1); | 313 .Times(1); |
313 | 314 |
314 // Manually request a load. | 315 // Manually request a load. |
315 loader->StartLoading(); | 316 loader->StartLoading(); |
316 Mock::VerifyAndClearExpectations(&visitor); | 317 Mock::VerifyAndClearExpectations(&visitor); |
317 | 318 |
318 RunUntilIdle(); | 319 RunUntilIdle(); |
319 EXPECT_FALSE(doc->IsReady()); | 320 EXPECT_FALSE(doc->IsReady()); |
(...skipping 17 matching lines...) Expand all Loading... |
337 &visitor, | 338 &visitor, |
338 loader, | 339 loader, |
339 profile.get(), | 340 profile.get(), |
340 extensions::Manifest::EXTERNAL_PREF, | 341 extensions::Manifest::EXTERNAL_PREF, |
341 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, | 342 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, |
342 extensions::Extension::FROM_WEBSTORE | | 343 extensions::Extension::FROM_WEBSTORE | |
343 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); | 344 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); |
344 | 345 |
345 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) | 346 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) |
346 .Times(0); | 347 .Times(0); |
347 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _)) | 348 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) |
348 .Times(0); | 349 .Times(0); |
349 EXPECT_CALL(visitor, OnExternalProviderReady(_)) | 350 EXPECT_CALL(visitor, OnExternalProviderReady(_)) |
350 .Times(1); | 351 .Times(1); |
351 | 352 |
352 // Manually request a load. | 353 // Manually request a load. |
353 loader->StartLoading(); | 354 loader->StartLoading(); |
354 Mock::VerifyAndClearExpectations(&visitor); | 355 Mock::VerifyAndClearExpectations(&visitor); |
355 | 356 |
356 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) | 357 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) |
357 .Times(0); | 358 .Times(0); |
358 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _)) | 359 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) |
359 .Times(2); | 360 .Times(2); |
360 EXPECT_CALL(visitor, OnExternalProviderReady(_)) | 361 EXPECT_CALL(visitor, OnExternalProviderReady(_)) |
361 .Times(1); | 362 .Times(1); |
362 | 363 |
363 RunUntilIdle(); | 364 RunUntilIdle(); |
364 EXPECT_TRUE(doc->IsReady()); | 365 EXPECT_TRUE(doc->IsReady()); |
365 } | 366 } |
366 | 367 |
367 } // namespace chromeos | 368 } // namespace chromeos |
OLD | NEW |