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

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: Rebase + review comments addressed 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 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/api/icons/icons_handler.h" 13 #include "chrome/common/extensions/api/icons/icons_handler.h"
14 #include "chrome/common/extensions/app_launcher_info.h"
14 #include "chrome/common/extensions/extension.h" 15 #include "chrome/common/extensions/extension.h"
15 #include "chrome/common/extensions/extension_icon_set.h" 16 #include "chrome/common/extensions/extension_icon_set.h"
16 #include "chrome/common/extensions/permissions/permission_set.h" 17 #include "chrome/common/extensions/permissions/permission_set.h"
17 #include "chrome/test/base/in_process_browser_test.h" 18 #include "chrome/test/base/in_process_browser_test.h"
18 #include "chrome/test/base/ui_test_utils.h" 19 #include "chrome/test/base/ui_test_utils.h"
19 #include "content/public/browser/notification_details.h" 20 #include "content/public/browser/notification_details.h"
20 #include "content/public/browser/notification_observer.h" 21 #include "content/public/browser/notification_observer.h"
21 #include "content/public/browser/notification_registrar.h" 22 #include "content/public/browser/notification_registrar.h"
22 #include "content/public/browser/notification_service.h" 23 #include "content/public/browser/notification_service.h"
23 24
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 "files/extensions/convert_web_app/application.html")); 70 "files/extensions/convert_web_app/application.html"));
70 71
71 if (!installed_extension_) 72 if (!installed_extension_)
72 content::RunMessageLoop(); 73 content::RunMessageLoop();
73 74
74 EXPECT_TRUE(installed_extension_); 75 EXPECT_TRUE(installed_extension_);
75 EXPECT_TRUE(installed_extension_->is_hosted_app()); 76 EXPECT_TRUE(installed_extension_->is_hosted_app());
76 EXPECT_EQ("Test application", installed_extension_->name()); 77 EXPECT_EQ("Test application", installed_extension_->name());
77 EXPECT_EQ("the description is", installed_extension_->description()); 78 EXPECT_EQ("the description is", installed_extension_->description());
78 EXPECT_EQ(extension_misc::LAUNCH_PANEL, 79 EXPECT_EQ(extension_misc::LAUNCH_PANEL,
79 installed_extension_->launch_container()); 80 AppLauncherInfo::GetLaunchContainer(installed_extension_));
80 81
81 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size()); 82 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size());
82 EXPECT_TRUE(installed_extension_->HasAPIPermission( 83 EXPECT_TRUE(installed_extension_->HasAPIPermission(
83 APIPermission::kGeolocation)); 84 APIPermission::kGeolocation));
84 EXPECT_TRUE(installed_extension_->HasAPIPermission( 85 EXPECT_TRUE(installed_extension_->HasAPIPermission(
85 APIPermission::kNotification)); 86 APIPermission::kNotification));
86 87
87 const ExtensionIconSet& icons = IconsInfo::GetIcons(installed_extension_); 88 const ExtensionIconSet& icons = IconsInfo::GetIcons(installed_extension_);
88 ASSERT_EQ(3u, icons.map().size()); 89 ASSERT_EQ(3u, icons.map().size());
89 EXPECT_EQ("icons/16.png", icons.Get(16, ExtensionIconSet::MATCH_EXACTLY)); 90 EXPECT_EQ("icons/16.png", icons.Get(16, ExtensionIconSet::MATCH_EXACTLY));
90 EXPECT_EQ("icons/48.png", icons.Get(48, ExtensionIconSet::MATCH_EXACTLY)); 91 EXPECT_EQ("icons/48.png", icons.Get(48, ExtensionIconSet::MATCH_EXACTLY));
91 EXPECT_EQ("icons/128.png", icons.Get(128, ExtensionIconSet::MATCH_EXACTLY)); 92 EXPECT_EQ("icons/128.png", icons.Get(128, ExtensionIconSet::MATCH_EXACTLY));
92 } 93 }
93 94
94 } // namespace extensions 95 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698