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

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate_unittest.cc

Issue 1305213009: Componentize PrefSyncableService and support classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable
Patch Set: Add missing dependency on //sync:test_support_sync_api for unit tests with gn Created 5 years, 3 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
14 #include "chrome/browser/download/chrome_download_manager_delegate.h" 14 #include "chrome/browser/download/chrome_download_manager_delegate.h"
15 #include "chrome/browser/download/download_prefs.h" 15 #include "chrome/browser/download/download_prefs.h"
16 #include "chrome/browser/download/download_target_info.h" 16 #include "chrome/browser/download/download_target_info.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 18 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
19 #include "chrome/test/base/testing_pref_service_syncable.h"
20 #include "chrome/test/base/testing_profile.h" 19 #include "chrome/test/base/testing_profile.h"
20 #include "components/syncable_prefs/testing_pref_service_syncable.h"
21 #include "content/public/browser/download_interrupt_reasons.h" 21 #include "content/public/browser/download_interrupt_reasons.h"
22 #include "content/public/browser/web_contents.h" 22 #include "content/public/browser/web_contents.h"
23 #include "content/public/browser/web_contents_delegate.h" 23 #include "content/public/browser/web_contents_delegate.h"
24 #include "content/public/test/mock_download_item.h" 24 #include "content/public/test/mock_download_item.h"
25 #include "content/public/test/mock_download_manager.h" 25 #include "content/public/test/mock_download_manager.h"
26 #include "content/public/test/test_renderer_host.h" 26 #include "content/public/test/test_renderer_host.h"
27 #include "content/public/test/web_contents_tester.h" 27 #include "content/public/test/web_contents_tester.h"
28 #include "testing/gmock/include/gmock/gmock.h" 28 #include "testing/gmock/include/gmock/gmock.h"
29 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
30 30
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 CreateActiveDownloadItem(1)); 395 CreateActiveDownloadItem(1));
396 EXPECT_CALL(*download_item, GetTargetFilePath()) 396 EXPECT_CALL(*download_item, GetTargetFilePath())
397 .WillRepeatedly(ReturnRef(existing_path)); 397 .WillRepeatedly(ReturnRef(existing_path));
398 EXPECT_TRUE(CheckForFileExistence(download_item.get())); 398 EXPECT_TRUE(CheckForFileExistence(download_item.get()));
399 399
400 download_item.reset(CreateActiveDownloadItem(1)); 400 download_item.reset(CreateActiveDownloadItem(1));
401 EXPECT_CALL(*download_item, GetTargetFilePath()) 401 EXPECT_CALL(*download_item, GetTargetFilePath())
402 .WillRepeatedly(ReturnRef(non_existent_path)); 402 .WillRepeatedly(ReturnRef(non_existent_path));
403 EXPECT_FALSE(CheckForFileExistence(download_item.get())); 403 EXPECT_FALSE(CheckForFileExistence(download_item.get()));
404 } 404 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/download/download_target_determiner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698