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

Side by Side Diff: chrome/browser/extensions/extension_webstore_private_apitest.cc

Issue 9837054: Improve WebstoreInstaller error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | 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_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "chrome/browser/extensions/bundle_installer.h" 10 #include "chrome/browser/extensions/bundle_installer.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 344 }
345 345
346 // Tests partially installing a bundle (2 succeed, 1 fails due to an invalid 346 // Tests partially installing a bundle (2 succeed, 1 fails due to an invalid
347 // CRX, and 1 fails due to the manifests not matching). 347 // CRX, and 1 fails due to the manifests not matching).
348 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateBundleTest, 348 IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateBundleTest,
349 InstallBundleInvalid) { 349 InstallBundleInvalid) {
350 extensions::BundleInstaller::SetAutoApproveForTesting(true); 350 extensions::BundleInstaller::SetAutoApproveForTesting(true);
351 351
352 PackInvalidCRX("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); 352 PackInvalidCRX("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
353 PackCRX("bmfoocgfinpmkmlbjhcbofejhkhlbchk", "extension1.json"); 353 PackCRX("bmfoocgfinpmkmlbjhcbofejhkhlbchk", "extension1.json");
354 PackCRX("pkapffpjmiilhlhbibjhamlmdhfneidj", "extension2.json");
355 PackCRX("begfmnajjkbjdgmffnjaojchoncnmngg", "app1.json"); 354 PackCRX("begfmnajjkbjdgmffnjaojchoncnmngg", "app1.json");
356 355
357 ASSERT_TRUE(RunPageTest(GetTestServerURL( 356 ASSERT_TRUE(RunPageTest(GetTestServerURL(
358 "install_bundle_invalid.html").spec())); 357 "install_bundle_invalid.html").spec()));
359 358
360 ASSERT_TRUE(service()->GetExtensionById( 359 ASSERT_TRUE(service()->GetExtensionById(
361 "begfmnajjkbjdgmffnjaojchoncnmngg", false)); 360 "begfmnajjkbjdgmffnjaojchoncnmngg", false));
362 ASSERT_TRUE(service()->GetExtensionById( 361 ASSERT_FALSE(service()->GetExtensionById(
363 "pkapffpjmiilhlhbibjhamlmdhfneidj", false)); 362 "pkapffpjmiilhlhbibjhamlmdhfneidj", true));
364 ASSERT_FALSE(service()->GetExtensionById( 363 ASSERT_FALSE(service()->GetExtensionById(
365 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", true)); 364 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", true));
366 ASSERT_FALSE(service()->GetExtensionById( 365 ASSERT_FALSE(service()->GetExtensionById(
367 "bmfoocgfinpmkmlbjhcbofejhkhlbchk", true)); 366 "bmfoocgfinpmkmlbjhcbofejhkhlbchk", true));
368 } 367 }
369 368
370 // Tests getWebGLStatus function when WebGL is allowed. 369 // Tests getWebGLStatus function when WebGL is allowed.
371 IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Allowed) { 370 IN_PROC_BROWSER_TEST_F(ExtensionWebstoreGetWebGLStatusTest, Allowed) {
372 bool webgl_allowed = true; 371 bool webgl_allowed = true;
373 RunTest(webgl_allowed); 372 RunTest(webgl_allowed);
(...skipping 20 matching lines...) Expand all
394 ASSERT_TRUE(blacklist->LoadGpuBlacklist( 393 ASSERT_TRUE(blacklist->LoadGpuBlacklist(
395 json_blacklist, GpuBlacklist::kAllOs)); 394 json_blacklist, GpuBlacklist::kAllOs));
396 blacklist->UpdateGpuDataManager(); 395 blacklist->UpdateGpuDataManager();
397 GpuFeatureType type = 396 GpuFeatureType type =
398 content::GpuDataManager::GetInstance()->GetGpuFeatureType(); 397 content::GpuDataManager::GetInstance()->GetGpuFeatureType();
399 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL); 398 EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL);
400 399
401 bool webgl_allowed = false; 400 bool webgl_allowed = false;
402 RunTest(webgl_allowed); 401 RunTest(webgl_allowed);
403 } 402 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/webstore_installer.h » ('j') | chrome/browser/extensions/webstore_installer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698