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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 <vector> 5 #include <vector>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallAccepted) { 184 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallAccepted) {
185 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx")); 185 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx"));
186 } 186 }
187 187
188 // Test having the default download directory missing. 188 // Test having the default download directory missing.
189 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, MissingDownloadDir) { 189 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, MissingDownloadDir) {
190 // Set a non-existent directory as the download path. 190 // Set a non-existent directory as the download path.
191 base::ScopedTempDir temp_dir; 191 base::ScopedTempDir temp_dir;
192 EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); 192 EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
193 base::FilePath missing_directory = temp_dir.Take(); 193 base::FilePath missing_directory = temp_dir.Take();
194 EXPECT_TRUE(file_util::Delete(missing_directory, true)); 194 EXPECT_TRUE(base::Delete(missing_directory, true));
195 WebstoreInstaller::SetDownloadDirectoryForTests(&missing_directory); 195 WebstoreInstaller::SetDownloadDirectoryForTests(&missing_directory);
196 196
197 // Now run the install test, which should succeed. 197 // Now run the install test, which should succeed.
198 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx")); 198 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx"));
199 199
200 // Cleanup. 200 // Cleanup.
201 if (file_util::DirectoryExists(missing_directory)) 201 if (file_util::DirectoryExists(missing_directory))
202 EXPECT_TRUE(file_util::Delete(missing_directory, true)); 202 EXPECT_TRUE(base::Delete(missing_directory, true));
203 } 203 }
204 204
205 // Tests passing a localized name. 205 // Tests passing a localized name.
206 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallLocalized) { 206 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallLocalized) {
207 ASSERT_TRUE(RunInstallTest("localized.html", "localized_extension.crx")); 207 ASSERT_TRUE(RunInstallTest("localized.html", "localized_extension.crx"));
208 } 208 }
209 209
210 // Now test the case where the user cancels the confirmation dialog. 210 // Now test the case where the user cancels the confirmation dialog.
211 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallCancelled) { 211 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallCancelled) {
212 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 212 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 content::GpuDataManager::GetInstance()->InitializeForTesting( 366 content::GpuDataManager::GetInstance()->InitializeForTesting(
367 json_blacklist, gpu_info); 367 json_blacklist, gpu_info);
368 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( 368 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
369 gpu::GPU_FEATURE_TYPE_WEBGL)); 369 gpu::GPU_FEATURE_TYPE_WEBGL));
370 370
371 bool webgl_allowed = false; 371 bool webgl_allowed = false;
372 RunTest(webgl_allowed); 372 RunTest(webgl_allowed);
373 } 373 }
374 374
375 } // namespace extensions 375 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698