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

Side by Side Diff: chrome/browser/chromeos/customization_document.cc

Issue 253833006: Add browser test for CustomizationWallpaperDownloader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 6 years, 7 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
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 "chrome/browser/chromeos/customization_document.h" 5 #include "chrome/browser/chromeos/customization_document.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 // static 451 // static
452 bool ServicesCustomizationDocument::WasOOBECustomizationApplied() { 452 bool ServicesCustomizationDocument::WasOOBECustomizationApplied() {
453 PrefService* prefs = g_browser_process->local_state(); 453 PrefService* prefs = g_browser_process->local_state();
454 // prefs can be NULL in some tests. 454 // prefs can be NULL in some tests.
455 if (prefs) 455 if (prefs)
456 return prefs->GetBoolean(kServicesCustomizationAppliedPref); 456 return prefs->GetBoolean(kServicesCustomizationAppliedPref);
457 else 457 else
458 return false; 458 return false;
459 } 459 }
460 460
461 CustomizationWallpaperDownloader*
462 ServicesCustomizationDocument::GetWallpaperDownloaderForTesting() const {
463 return wallpaper_downloader_.get();
464 }
465
461 // static 466 // static
462 void ServicesCustomizationDocument::SetApplied(bool val) { 467 void ServicesCustomizationDocument::SetApplied(bool val) {
463 PrefService* prefs = g_browser_process->local_state(); 468 PrefService* prefs = g_browser_process->local_state();
464 // prefs can be NULL in some tests. 469 // prefs can be NULL in some tests.
465 if (prefs) 470 if (prefs)
466 prefs->SetBoolean(kServicesCustomizationAppliedPref, val); 471 prefs->SetBoolean(kServicesCustomizationAppliedPref, val);
467 } 472 }
468 473
469 // static 474 // static
470 base::FilePath ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir() { 475 base::FilePath ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir() {
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 apply_tasks_success_ += success; 965 apply_tasks_success_ += success;
961 966
962 if (apply_tasks_started_ != apply_tasks_finished_) 967 if (apply_tasks_started_ != apply_tasks_finished_)
963 return; 968 return;
964 969
965 if (apply_tasks_success_ == apply_tasks_finished_) 970 if (apply_tasks_success_ == apply_tasks_finished_)
966 SetApplied(true); 971 SetApplied(true);
967 } 972 }
968 973
969 } // namespace chromeos 974 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698