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

Side by Side Diff: chrome/browser/extensions/convert_web_app_browsertest.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, 10 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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/common/chrome_notification_types.h" 11 #include "chrome/common/chrome_notification_types.h"
12 #include "chrome/common/chrome_switches.h" 12 #include "chrome/common/chrome_switches.h"
13 #include "chrome/common/extensions/app_launch_manifest_handler.h"
13 #include "chrome/common/extensions/extension.h" 14 #include "chrome/common/extensions/extension.h"
14 #include "chrome/common/extensions/permissions/permission_set.h" 15 #include "chrome/common/extensions/permissions/permission_set.h"
15 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
16 #include "chrome/test/base/ui_test_utils.h" 17 #include "chrome/test/base/ui_test_utils.h"
17 #include "content/public/browser/notification_details.h" 18 #include "content/public/browser/notification_details.h"
18 #include "content/public/browser/notification_observer.h" 19 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 20 #include "content/public/browser/notification_registrar.h"
20 #include "content/public/browser/notification_service.h" 21 #include "content/public/browser/notification_service.h"
21 22
22 namespace extensions { 23 namespace extensions {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 "files/extensions/convert_web_app/application.html")); 68 "files/extensions/convert_web_app/application.html"));
68 69
69 if (!installed_extension_) 70 if (!installed_extension_)
70 content::RunMessageLoop(); 71 content::RunMessageLoop();
71 72
72 EXPECT_TRUE(installed_extension_); 73 EXPECT_TRUE(installed_extension_);
73 EXPECT_TRUE(installed_extension_->is_hosted_app()); 74 EXPECT_TRUE(installed_extension_->is_hosted_app());
74 EXPECT_EQ("Test application", installed_extension_->name()); 75 EXPECT_EQ("Test application", installed_extension_->name());
75 EXPECT_EQ("the description is", installed_extension_->description()); 76 EXPECT_EQ("the description is", installed_extension_->description());
76 EXPECT_EQ(extension_misc::LAUNCH_PANEL, 77 EXPECT_EQ(extension_misc::LAUNCH_PANEL,
77 installed_extension_->launch_container()); 78 AppLaunchInfo::GetLaunchContainer(installed_extension_));
78 79
79 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size()); 80 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size());
80 EXPECT_TRUE(installed_extension_->HasAPIPermission( 81 EXPECT_TRUE(installed_extension_->HasAPIPermission(
81 APIPermission::kGeolocation)); 82 APIPermission::kGeolocation));
82 EXPECT_TRUE(installed_extension_->HasAPIPermission( 83 EXPECT_TRUE(installed_extension_->HasAPIPermission(
83 APIPermission::kNotification)); 84 APIPermission::kNotification));
84 85
85 ASSERT_EQ(3u, installed_extension_->icons().map().size()); 86 ASSERT_EQ(3u, installed_extension_->icons().map().size());
86 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( 87 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get(
87 16, ExtensionIconSet::MATCH_EXACTLY)); 88 16, ExtensionIconSet::MATCH_EXACTLY));
88 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( 89 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get(
89 48, ExtensionIconSet::MATCH_EXACTLY)); 90 48, ExtensionIconSet::MATCH_EXACTLY));
90 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( 91 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get(
91 128, ExtensionIconSet::MATCH_EXACTLY)); 92 128, ExtensionIconSet::MATCH_EXACTLY));
92 } 93 }
93 94
94 } // namespace extensions 95 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698