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

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

Issue 10649003: Move each permission classes to its own files in extensions/permissions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase on HEAD Created 8 years, 6 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
11 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/common/extensions/extension.h" 12 #include "chrome/common/extensions/extension.h"
13 #include "chrome/test/base/in_process_browser_test.h" 13 #include "chrome/test/base/in_process_browser_test.h"
14 #include "chrome/test/base/ui_test_utils.h" 14 #include "chrome/test/base/ui_test_utils.h"
15 #include "content/public/browser/notification_details.h" 15 #include "content/public/browser/notification_details.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 19
20 using extensions::APIPermission;
21
20 class ExtensionFromWebAppTest 22 class ExtensionFromWebAppTest
21 : public InProcessBrowserTest, public content::NotificationObserver { 23 : public InProcessBrowserTest, public content::NotificationObserver {
22 protected: 24 protected:
23 ExtensionFromWebAppTest() : installed_extension_(NULL) { 25 ExtensionFromWebAppTest() : installed_extension_(NULL) {
24 } 26 }
25 27
26 std::string expected_extension_id_; 28 std::string expected_extension_id_;
27 const extensions::Extension* installed_extension_; 29 const extensions::Extension* installed_extension_;
28 30
29 private: 31 private:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 69
68 EXPECT_TRUE(installed_extension_); 70 EXPECT_TRUE(installed_extension_);
69 EXPECT_TRUE(installed_extension_->is_hosted_app()); 71 EXPECT_TRUE(installed_extension_->is_hosted_app());
70 EXPECT_EQ("Test application", installed_extension_->name()); 72 EXPECT_EQ("Test application", installed_extension_->name());
71 EXPECT_EQ("the description is", installed_extension_->description()); 73 EXPECT_EQ("the description is", installed_extension_->description());
72 EXPECT_EQ(extension_misc::LAUNCH_PANEL, 74 EXPECT_EQ(extension_misc::LAUNCH_PANEL,
73 installed_extension_->launch_container()); 75 installed_extension_->launch_container());
74 76
75 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size()); 77 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size());
76 EXPECT_TRUE(installed_extension_->HasAPIPermission( 78 EXPECT_TRUE(installed_extension_->HasAPIPermission(
77 ExtensionAPIPermission::kGeolocation)); 79 APIPermission::kGeolocation));
78 EXPECT_TRUE(installed_extension_->HasAPIPermission( 80 EXPECT_TRUE(installed_extension_->HasAPIPermission(
79 ExtensionAPIPermission::kNotification)); 81 APIPermission::kNotification));
80 82
81 ASSERT_EQ(3u, installed_extension_->icons().map().size()); 83 ASSERT_EQ(3u, installed_extension_->icons().map().size());
82 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( 84 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get(
83 16, ExtensionIconSet::MATCH_EXACTLY)); 85 16, ExtensionIconSet::MATCH_EXACTLY));
84 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( 86 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get(
85 48, ExtensionIconSet::MATCH_EXACTLY)); 87 48, ExtensionIconSet::MATCH_EXACTLY));
86 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( 88 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get(
87 128, ExtensionIconSet::MATCH_EXACTLY)); 89 128, ExtensionIconSet::MATCH_EXACTLY));
88 } 90 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/bundle_installer.cc ('k') | chrome/browser/extensions/extension_font_settings_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698