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

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

Issue 2835233002: Fix integration tests in src/chrome and src/extensions so that we can turn on IO thread checks wi... (Closed)
Patch Set: ready for review Created 3 years, 8 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 <vector> 5 #include <vector>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/threading/thread_restrictions.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" 14 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
14 #include "chrome/browser/extensions/extension_apitest.h" 15 #include "chrome/browser/extensions/extension_apitest.h"
15 #include "chrome/browser/extensions/extension_function_test_utils.h" 16 #include "chrome/browser/extensions/extension_function_test_utils.h"
16 #include "chrome/browser/extensions/extension_install_prompt.h" 17 #include "chrome/browser/extensions/extension_install_prompt.h"
17 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/extensions/webstore_installer.h" 19 #include "chrome/browser/extensions/webstore_installer.h"
19 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 212 }
212 213
213 // Test cases where the user accepts the install confirmation dialog. 214 // Test cases where the user accepts the install confirmation dialog.
214 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallAccepted) { 215 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, InstallAccepted) {
215 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx")); 216 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx"));
216 } 217 }
217 218
218 // Test having the default download directory missing. 219 // Test having the default download directory missing.
219 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, MissingDownloadDir) { 220 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, MissingDownloadDir) {
220 // Set a non-existent directory as the download path. 221 // Set a non-existent directory as the download path.
222 base::ThreadRestrictions::ScopedAllowIO allow_io;
221 base::ScopedTempDir temp_dir; 223 base::ScopedTempDir temp_dir;
222 EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); 224 EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
223 base::FilePath missing_directory = temp_dir.Take(); 225 base::FilePath missing_directory = temp_dir.Take();
224 EXPECT_TRUE(base::DeleteFile(missing_directory, true)); 226 EXPECT_TRUE(base::DeleteFile(missing_directory, true));
225 WebstoreInstaller::SetDownloadDirectoryForTests(&missing_directory); 227 WebstoreInstaller::SetDownloadDirectoryForTests(&missing_directory);
226 228
227 // Now run the install test, which should succeed. 229 // Now run the install test, which should succeed.
228 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx")); 230 ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx"));
229 231
230 // Cleanup. 232 // Cleanup.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Blocked) { 415 IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Blocked) {
414 content::GpuDataManager::GetInstance()->BlacklistWebGLForTesting(); 416 content::GpuDataManager::GetInstance()->BlacklistWebGLForTesting();
415 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( 417 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
416 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL)); 418 gpu::GPU_FEATURE_TYPE_ACCELERATED_WEBGL));
417 419
418 bool webgl_allowed = false; 420 bool webgl_allowed = false;
419 RunTest(webgl_allowed); 421 RunTest(webgl_allowed);
420 } 422 }
421 423
422 } // namespace extensions 424 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698