OLD | NEW |
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 "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" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, | 58 registrar.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, |
59 content::NotificationService::AllSources()); | 59 content::NotificationService::AllSources()); |
60 | 60 |
61 expected_extension_id_ = "fnpgoaochgbdfjndakichfafiocjjpmm"; | 61 expected_extension_id_ = "fnpgoaochgbdfjndakichfafiocjjpmm"; |
62 ui_test_utils::NavigateToURL( | 62 ui_test_utils::NavigateToURL( |
63 browser(), | 63 browser(), |
64 test_server()->GetURL( | 64 test_server()->GetURL( |
65 "files/extensions/convert_web_app/application.html")); | 65 "files/extensions/convert_web_app/application.html")); |
66 | 66 |
67 if (!installed_extension_) | 67 if (!installed_extension_) |
68 ui_test_utils::RunMessageLoop(); | 68 content::RunMessageLoop(); |
69 | 69 |
70 EXPECT_TRUE(installed_extension_); | 70 EXPECT_TRUE(installed_extension_); |
71 EXPECT_TRUE(installed_extension_->is_hosted_app()); | 71 EXPECT_TRUE(installed_extension_->is_hosted_app()); |
72 EXPECT_EQ("Test application", installed_extension_->name()); | 72 EXPECT_EQ("Test application", installed_extension_->name()); |
73 EXPECT_EQ("the description is", installed_extension_->description()); | 73 EXPECT_EQ("the description is", installed_extension_->description()); |
74 EXPECT_EQ(extension_misc::LAUNCH_PANEL, | 74 EXPECT_EQ(extension_misc::LAUNCH_PANEL, |
75 installed_extension_->launch_container()); | 75 installed_extension_->launch_container()); |
76 | 76 |
77 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size()); | 77 ASSERT_EQ(2u, installed_extension_->GetActivePermissions()->apis().size()); |
78 EXPECT_TRUE(installed_extension_->HasAPIPermission( | 78 EXPECT_TRUE(installed_extension_->HasAPIPermission( |
79 APIPermission::kGeolocation)); | 79 APIPermission::kGeolocation)); |
80 EXPECT_TRUE(installed_extension_->HasAPIPermission( | 80 EXPECT_TRUE(installed_extension_->HasAPIPermission( |
81 APIPermission::kNotification)); | 81 APIPermission::kNotification)); |
82 | 82 |
83 ASSERT_EQ(3u, installed_extension_->icons().map().size()); | 83 ASSERT_EQ(3u, installed_extension_->icons().map().size()); |
84 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( | 84 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( |
85 16, ExtensionIconSet::MATCH_EXACTLY)); | 85 16, ExtensionIconSet::MATCH_EXACTLY)); |
86 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( | 86 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( |
87 48, ExtensionIconSet::MATCH_EXACTLY)); | 87 48, ExtensionIconSet::MATCH_EXACTLY)); |
88 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( | 88 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( |
89 128, ExtensionIconSet::MATCH_EXACTLY)); | 89 128, ExtensionIconSet::MATCH_EXACTLY)); |
90 } | 90 } |
OLD | NEW |