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

Unified Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 12316077: Move the parsing of app.launch related keys out of Extension class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service_unittest.cc
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 256b28a0bc9fc4735e372128c1ab501b5e452254..4b79ab03f9f8bc588e5212434bc6194ca57ec320 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -64,6 +64,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/i18n/default_locale_handler.h"
#include "chrome/common/extensions/api/plugins/plugins_handler.h"
+#include "chrome/common/extensions/app_launcher_info.h"
#include "chrome/common/extensions/background_info.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_l10n_util.h"
@@ -546,6 +547,7 @@ void ExtensionServiceTestBase::SetUpTestCase() {
void ExtensionServiceTestBase::SetUp() {
testing::Test::SetUp();
ExtensionErrorReporter::GetInstance()->ClearErrors();
+ (new extensions::AppLaunchManifestHandler)->Register();
(new extensions::BackgroundManifestHandler)->Register();
(new extensions::DefaultLocaleHandler)->Register();
(new extensions::PluginsHandler)->Register();
@@ -2342,8 +2344,9 @@ TEST_F(ExtensionServiceTest, InstallAppsWithUnlimitedStorage) {
EXPECT_TRUE(extension->HasAPIPermission(
APIPermission::kUnlimitedStorage));
EXPECT_TRUE(extension->web_extent().MatchesURL(
- extension->GetFullLaunchURL()));
- const GURL origin1(extension->GetFullLaunchURL().GetOrigin());
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension)));
+ const GURL origin1(
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension).GetOrigin());
EXPECT_TRUE(profile_->GetExtensionSpecialStoragePolicy()->
IsStorageUnlimited(origin1));
@@ -2355,8 +2358,9 @@ TEST_F(ExtensionServiceTest, InstallAppsWithUnlimitedStorage) {
EXPECT_TRUE(extension->HasAPIPermission(
APIPermission::kUnlimitedStorage));
EXPECT_TRUE(extension->web_extent().MatchesURL(
- extension->GetFullLaunchURL()));
- const GURL origin2(extension->GetFullLaunchURL().GetOrigin());
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension)));
+ const GURL origin2(
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension).GetOrigin());
EXPECT_EQ(origin1, origin2);
EXPECT_TRUE(profile_->GetExtensionSpecialStoragePolicy()->
IsStorageUnlimited(origin2));
@@ -2389,7 +2393,8 @@ TEST_F(ExtensionServiceTest, InstallAppsAndCheckStorageProtection) {
ASSERT_EQ(1u, service_->extensions()->size());
EXPECT_TRUE(extension->is_app());
const std::string id1 = extension->id();
- const GURL origin1(extension->GetFullLaunchURL().GetOrigin());
+ const GURL origin1(
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension).GetOrigin());
EXPECT_TRUE(profile_->GetExtensionSpecialStoragePolicy()->
IsStorageProtected(origin1));
@@ -2398,7 +2403,8 @@ TEST_F(ExtensionServiceTest, InstallAppsAndCheckStorageProtection) {
ValidatePrefKeyCount(++pref_count);
ASSERT_EQ(2u, service_->extensions()->size());
const std::string id2 = extension->id();
- const GURL origin2(extension->GetFullLaunchURL().GetOrigin());
+ const GURL origin2(
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension).GetOrigin());
ASSERT_NE(origin1, origin2);
EXPECT_TRUE(profile_->GetExtensionSpecialStoragePolicy()->
IsStorageProtected(origin2));
@@ -3902,7 +3908,8 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
const std::string id1 = extension->id();
EXPECT_TRUE(extension->HasAPIPermission(
APIPermission::kUnlimitedStorage));
- const GURL origin1(extension->GetFullLaunchURL().GetOrigin());
+ const GURL origin1(
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension).GetOrigin());
EXPECT_TRUE(profile_->GetExtensionSpecialStoragePolicy()->
IsStorageUnlimited(origin1));
string16 origin_id =
@@ -3916,8 +3923,9 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
EXPECT_TRUE(extension->HasAPIPermission(
APIPermission::kUnlimitedStorage));
EXPECT_TRUE(extension->web_extent().MatchesURL(
- extension->GetFullLaunchURL()));
- const GURL origin2(extension->GetFullLaunchURL().GetOrigin());
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension)));
+ const GURL origin2(
+ extensions::AppLauncherInfo::GetFullLaunchURL(extension).GetOrigin());
EXPECT_EQ(origin1, origin2);
EXPECT_TRUE(profile_->GetExtensionSpecialStoragePolicy()->
IsStorageUnlimited(origin2));
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698