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

Side by Side Diff: chrome/browser/chromeos/customization/customization_document_unittest.cc

Issue 974713002: kiosk: Ensure launching latest version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest compile Created 5 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/customization_document.h" 5 #include "chrome/browser/chromeos/customization/customization_document.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/prefs/testing_pref_service.h" 8 #include "base/prefs/testing_pref_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 new net::HttpResponseHeaders(""); 172 new net::HttpResponseHeaders("");
173 download_headers->AddHeader("Content-Type: application/json"); 173 download_headers->AddHeader("Content-Type: application/json");
174 fetcher->set_response_headers(download_headers); 174 fetcher->set_response_headers(download_headers);
175 } 175 }
176 176
177 class MockExternalProviderVisitor 177 class MockExternalProviderVisitor
178 : public extensions::ExternalProviderInterface::VisitorInterface { 178 : public extensions::ExternalProviderInterface::VisitorInterface {
179 public: 179 public:
180 MockExternalProviderVisitor() {} 180 MockExternalProviderVisitor() {}
181 181
182 MOCK_METHOD6(OnExternalExtensionFileFound, 182 MOCK_METHOD7(OnExternalExtensionFileFound,
183 bool(const std::string&, 183 bool(const std::string&,
184 const base::Version*, 184 const base::Version*,
185 const base::FilePath&, 185 const base::FilePath&,
186 extensions::Manifest::Location, 186 extensions::Manifest::Location,
187 int, 187 int,
188 bool,
188 bool)); 189 bool));
189 MOCK_METHOD6(OnExternalExtensionUpdateUrlFound, 190 MOCK_METHOD6(OnExternalExtensionUpdateUrlFound,
190 bool(const std::string&, 191 bool(const std::string&,
191 const std::string&, 192 const std::string&,
192 const GURL&, 193 const GURL&,
193 extensions::Manifest::Location, 194 extensions::Manifest::Location,
194 int, 195 int,
195 bool)); 196 bool));
196 MOCK_METHOD1(OnExternalProviderReady, 197 MOCK_METHOD1(OnExternalProviderReady,
197 void(const extensions::ExternalProviderInterface* provider)); 198 void(const extensions::ExternalProviderInterface* provider));
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 scoped_ptr<extensions::ExternalProviderImpl> provider( 339 scoped_ptr<extensions::ExternalProviderImpl> provider(
339 new extensions::ExternalProviderImpl( 340 new extensions::ExternalProviderImpl(
340 &visitor, 341 &visitor,
341 loader, 342 loader,
342 profile.get(), 343 profile.get(),
343 extensions::Manifest::EXTERNAL_PREF, 344 extensions::Manifest::EXTERNAL_PREF,
344 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, 345 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD,
345 extensions::Extension::FROM_WEBSTORE | 346 extensions::Extension::FROM_WEBSTORE |
346 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); 347 extensions::Extension::WAS_INSTALLED_BY_DEFAULT));
347 348
348 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) 349 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _, _))
349 .Times(0); 350 .Times(0);
350 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) 351 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _))
351 .Times(0); 352 .Times(0);
352 EXPECT_CALL(visitor, OnExternalProviderReady(_)) 353 EXPECT_CALL(visitor, OnExternalProviderReady(_))
353 .Times(1); 354 .Times(1);
354 355
355 // Manually request a load. 356 // Manually request a load.
356 RunUntilIdle(); 357 RunUntilIdle();
357 loader->StartLoading(); 358 loader->StartLoading();
358 Mock::VerifyAndClearExpectations(&visitor); 359 Mock::VerifyAndClearExpectations(&visitor);
(...skipping 24 matching lines...) Expand all
383 scoped_ptr<extensions::ExternalProviderImpl> provider( 384 scoped_ptr<extensions::ExternalProviderImpl> provider(
384 new extensions::ExternalProviderImpl( 385 new extensions::ExternalProviderImpl(
385 &visitor, 386 &visitor,
386 loader, 387 loader,
387 profile.get(), 388 profile.get(),
388 extensions::Manifest::EXTERNAL_PREF, 389 extensions::Manifest::EXTERNAL_PREF,
389 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, 390 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD,
390 extensions::Extension::FROM_WEBSTORE | 391 extensions::Extension::FROM_WEBSTORE |
391 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); 392 extensions::Extension::WAS_INSTALLED_BY_DEFAULT));
392 393
393 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) 394 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _, _))
394 .Times(0); 395 .Times(0);
395 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) 396 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _))
396 .Times(0); 397 .Times(0);
397 EXPECT_CALL(visitor, OnExternalProviderReady(_)) 398 EXPECT_CALL(visitor, OnExternalProviderReady(_))
398 .Times(1); 399 .Times(1);
399 400
400 // Manually request a load. 401 // Manually request a load.
401 loader->StartLoading(); 402 loader->StartLoading();
402 Mock::VerifyAndClearExpectations(&visitor); 403 Mock::VerifyAndClearExpectations(&visitor);
403 404
404 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) 405 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _, _))
405 .Times(0); 406 .Times(0);
406 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) 407 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _))
407 .Times(2); 408 .Times(2);
408 EXPECT_CALL(visitor, OnExternalProviderReady(_)) 409 EXPECT_CALL(visitor, OnExternalProviderReady(_))
409 .Times(1); 410 .Times(1);
410 411
411 RunUntilIdle(); 412 RunUntilIdle();
412 EXPECT_TRUE(doc->IsReady()); 413 EXPECT_TRUE(doc->IsReady());
413 414
414 app_list::AppListSyncableService* service = 415 app_list::AppListSyncableService* service =
(...skipping 18 matching lines...) Expand all
433 scoped_ptr<extensions::ExternalProviderImpl> provider( 434 scoped_ptr<extensions::ExternalProviderImpl> provider(
434 new extensions::ExternalProviderImpl( 435 new extensions::ExternalProviderImpl(
435 &visitor, 436 &visitor,
436 loader, 437 loader,
437 profile.get(), 438 profile.get(),
438 extensions::Manifest::EXTERNAL_PREF, 439 extensions::Manifest::EXTERNAL_PREF,
439 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD, 440 extensions::Manifest::EXTERNAL_PREF_DOWNLOAD,
440 extensions::Extension::FROM_WEBSTORE | 441 extensions::Extension::FROM_WEBSTORE |
441 extensions::Extension::WAS_INSTALLED_BY_DEFAULT)); 442 extensions::Extension::WAS_INSTALLED_BY_DEFAULT));
442 443
443 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) 444 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _, _))
444 .Times(0); 445 .Times(0);
445 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) 446 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _))
446 .Times(0); 447 .Times(0);
447 EXPECT_CALL(visitor, OnExternalProviderReady(_)) 448 EXPECT_CALL(visitor, OnExternalProviderReady(_))
448 .Times(1); 449 .Times(1);
449 450
450 // Manually request a load. 451 // Manually request a load.
451 loader->StartLoading(); 452 loader->StartLoading();
452 Mock::VerifyAndClearExpectations(&visitor); 453 Mock::VerifyAndClearExpectations(&visitor);
453 454
454 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _)) 455 EXPECT_CALL(visitor, OnExternalExtensionFileFound(_, _, _, _, _, _, _))
455 .Times(0); 456 .Times(0);
456 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _)) 457 EXPECT_CALL(visitor, OnExternalExtensionUpdateUrlFound(_, _, _, _, _, _))
457 .Times(0); 458 .Times(0);
458 EXPECT_CALL(visitor, OnExternalProviderReady(_)) 459 EXPECT_CALL(visitor, OnExternalProviderReady(_))
459 .Times(1); 460 .Times(1);
460 461
461 RunUntilIdle(); 462 RunUntilIdle();
462 EXPECT_TRUE(doc->IsReady()); 463 EXPECT_TRUE(doc->IsReady());
463 } 464 }
464 465
465 } // namespace chromeos 466 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698