OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/download/download_prefs.h" | 9 #include "chrome/browser/download/download_prefs.h" |
10 #include "chrome/browser/prefs/pref_service_syncable.h" | 10 #include "chrome/browser/prefs/pref_service_syncable.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 base::FilePath new_download_dir = download_dir.AppendASCII("my_downloads"); | 52 base::FilePath new_download_dir = download_dir.AppendASCII("my_downloads"); |
53 base::FilePath downloaded_pkg = | 53 base::FilePath downloaded_pkg = |
54 new_download_dir.AppendASCII("a_zip_file.zip"); | 54 new_download_dir.AppendASCII("a_zip_file.zip"); |
55 | 55 |
56 // If the directory exists, delete it. | 56 // If the directory exists, delete it. |
57 if (base::PathExists(new_download_dir)) { | 57 if (base::PathExists(new_download_dir)) { |
58 base::DeleteFile(new_download_dir, true); | 58 base::DeleteFile(new_download_dir, true); |
59 } | 59 } |
60 | 60 |
61 // Create the new downloads directory. | 61 // Create the new downloads directory. |
62 file_util::CreateDirectory(new_download_dir); | 62 base::CreateDirectory(new_download_dir); |
63 // Set pref to download in new_download_dir. | 63 // Set pref to download in new_download_dir. |
64 browser()->profile()->GetPrefs()->SetFilePath( | 64 browser()->profile()->GetPrefs()->SetFilePath( |
65 prefs::kDownloadDefaultDirectory, | 65 prefs::kDownloadDefaultDirectory, |
66 new_download_dir); | 66 new_download_dir); |
67 | 67 |
68 // Create a downloads observer. | 68 // Create a downloads observer. |
69 scoped_ptr<content::DownloadTestObserver> downloads_observer( | 69 scoped_ptr<content::DownloadTestObserver> downloads_observer( |
70 CreateWaiter(browser(), 1)); | 70 CreateWaiter(browser(), 1)); |
71 ui_test_utils::NavigateToURL( | 71 ui_test_utils::NavigateToURL( |
72 browser(), | 72 browser(), |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); | 246 EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); |
247 EXPECT_FALSE(prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)); | 247 EXPECT_FALSE(prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)); |
248 EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); | 248 EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); |
249 } | 249 } |
250 | 250 |
251 // Verify that we have some Local State prefs. | 251 // Verify that we have some Local State prefs. |
252 IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestHaveLocalStatePrefs) { | 252 IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestHaveLocalStatePrefs) { |
253 EXPECT_TRUE(g_browser_process->local_state()->GetPreferenceValues().get()); | 253 EXPECT_TRUE(g_browser_process->local_state()->GetPreferenceValues().get()); |
254 } | 254 } |
255 | 255 |
OLD | NEW |