OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/extensions/extensions_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/common/extensions/extension.h" | 11 #include "chrome/common/extensions/extension.h" |
12 #include "chrome/common/notification_details.h" | 12 #include "chrome/common/notification_details.h" |
13 #include "chrome/common/notification_observer.h" | 13 #include "chrome/common/notification_observer.h" |
14 #include "chrome/common/notification_registrar.h" | 14 #include "chrome/common/notification_registrar.h" |
15 #include "chrome/common/notification_type.h" | 15 #include "chrome/common/notification_type.h" |
16 #include "chrome/test/in_process_browser_test.h" | 16 #include "chrome/test/in_process_browser_test.h" |
17 #include "chrome/test/ui_test_utils.h" | 17 #include "chrome/test/ui_test_utils.h" |
18 | 18 |
19 class ExtensionFromWebAppTest | 19 class ExtensionFromWebAppTest |
(...skipping 20 matching lines...) Expand all Loading... |
40 if (extension->id() == expected_extension_id_) { | 40 if (extension->id() == expected_extension_id_) { |
41 installed_extension_ = extension; | 41 installed_extension_ = extension; |
42 MessageLoopForUI::current()->Quit(); | 42 MessageLoopForUI::current()->Quit(); |
43 } | 43 } |
44 } | 44 } |
45 } | 45 } |
46 }; | 46 }; |
47 | 47 |
48 IN_PROC_BROWSER_TEST_F(ExtensionFromWebAppTest, Basic) { | 48 IN_PROC_BROWSER_TEST_F(ExtensionFromWebAppTest, Basic) { |
49 ASSERT_TRUE(test_server()->Start()); | 49 ASSERT_TRUE(test_server()->Start()); |
50 browser()->profile()->GetExtensionsService()->set_show_extensions_prompts( | 50 browser()->profile()->GetExtensionService()->set_show_extensions_prompts( |
51 false); | 51 false); |
52 | 52 |
53 NotificationRegistrar registrar; | 53 NotificationRegistrar registrar; |
54 registrar.Add(this, NotificationType::EXTENSION_INSTALLED, | 54 registrar.Add(this, NotificationType::EXTENSION_INSTALLED, |
55 NotificationService::AllSources()); | 55 NotificationService::AllSources()); |
56 | 56 |
57 expected_extension_id_ = "fnpgoaochgbdfjndakichfafiocjjpmm"; | 57 expected_extension_id_ = "fnpgoaochgbdfjndakichfafiocjjpmm"; |
58 ui_test_utils::NavigateToURL( | 58 ui_test_utils::NavigateToURL( |
59 browser(), | 59 browser(), |
60 test_server()->GetURL( | 60 test_server()->GetURL( |
(...skipping 16 matching lines...) Expand all Loading... |
77 installed_extension_->api_permissions().end()); | 77 installed_extension_->api_permissions().end()); |
78 | 78 |
79 ASSERT_EQ(3u, installed_extension_->icons().map().size()); | 79 ASSERT_EQ(3u, installed_extension_->icons().map().size()); |
80 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( | 80 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( |
81 16, ExtensionIconSet::MATCH_EXACTLY)); | 81 16, ExtensionIconSet::MATCH_EXACTLY)); |
82 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( | 82 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( |
83 48, ExtensionIconSet::MATCH_EXACTLY)); | 83 48, ExtensionIconSet::MATCH_EXACTLY)); |
84 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( | 84 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( |
85 128, ExtensionIconSet::MATCH_EXACTLY)); | 85 128, ExtensionIconSet::MATCH_EXACTLY)); |
86 } | 86 } |
OLD | NEW |