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

Side by Side Diff: chrome/browser/prefs/pref_functional_browsertest.cc

Issue 2317123002: c/browser, c/common, components O-P: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 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 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/memory/ptr_util.h" 7 #include "base/memory/ptr_util.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/net/prediction_options.h" 10 #include "chrome/browser/net/prediction_options.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return base::WrapUnique(downloads_observer); 49 return base::WrapUnique(downloads_observer);
50 } 50 }
51 }; 51 };
52 52
53 IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestDownloadDirPref) { 53 IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestDownloadDirPref) {
54 ASSERT_TRUE(embedded_test_server()->Start()); 54 ASSERT_TRUE(embedded_test_server()->Start());
55 base::ScopedTempDir new_download_dir; 55 base::ScopedTempDir new_download_dir;
56 ASSERT_TRUE(new_download_dir.CreateUniqueTempDir()); 56 ASSERT_TRUE(new_download_dir.CreateUniqueTempDir());
57 57
58 base::FilePath downloaded_pkg = 58 base::FilePath downloaded_pkg =
59 new_download_dir.path().AppendASCII("a_zip_file.zip"); 59 new_download_dir.GetPath().AppendASCII("a_zip_file.zip");
60 60
61 // Set pref to download in new_download_dir. 61 // Set pref to download in new_download_dir.
62 browser()->profile()->GetPrefs()->SetFilePath( 62 browser()->profile()->GetPrefs()->SetFilePath(
63 prefs::kDownloadDefaultDirectory, new_download_dir.path()); 63 prefs::kDownloadDefaultDirectory, new_download_dir.GetPath());
64 64
65 // Create a downloads observer. 65 // Create a downloads observer.
66 std::unique_ptr<content::DownloadTestObserver> downloads_observer( 66 std::unique_ptr<content::DownloadTestObserver> downloads_observer(
67 CreateWaiter(browser(), 1)); 67 CreateWaiter(browser(), 1));
68 ui_test_utils::NavigateToURL( 68 ui_test_utils::NavigateToURL(
69 browser(), embedded_test_server()->GetURL("/downloads/a_zip_file.zip")); 69 browser(), embedded_test_server()->GetURL("/downloads/a_zip_file.zip"));
70 // Waits for the download to complete. 70 // Waits for the download to complete.
71 downloads_observer->WaitForFinished(); 71 downloads_observer->WaitForFinished();
72 EXPECT_TRUE(base::PathExists(downloaded_pkg)); 72 EXPECT_TRUE(base::PathExists(downloaded_pkg));
73 } 73 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 prefs->GetInteger(prefs::kNetworkPredictionOptions)); 232 prefs->GetInteger(prefs::kNetworkPredictionOptions));
233 EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); 233 EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled));
234 EXPECT_FALSE(prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)); 234 EXPECT_FALSE(prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled));
235 EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); 235 EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled));
236 } 236 }
237 237
238 // Verify that we have some Local State prefs. 238 // Verify that we have some Local State prefs.
239 IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestHaveLocalStatePrefs) { 239 IN_PROC_BROWSER_TEST_F(PrefsFunctionalTest, TestHaveLocalStatePrefs) {
240 EXPECT_TRUE(g_browser_process->local_state()->GetPreferenceValues().get()); 240 EXPECT_TRUE(g_browser_process->local_state()->GetPreferenceValues().get());
241 } 241 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/test/local_policy_test_server.cc ('k') | chrome/browser/prefs/profile_pref_store_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698