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 "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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 : public InProcessBrowserTest, public content::NotificationObserver { | 25 : public InProcessBrowserTest, public content::NotificationObserver { |
26 protected: | 26 protected: |
27 ExtensionFromWebAppTest() : installed_extension_(NULL) { | 27 ExtensionFromWebAppTest() : installed_extension_(NULL) { |
28 } | 28 } |
29 | 29 |
30 std::string expected_extension_id_; | 30 std::string expected_extension_id_; |
31 const Extension* installed_extension_; | 31 const Extension* installed_extension_; |
32 | 32 |
33 private: | 33 private: |
34 // InProcessBrowserTest | 34 // InProcessBrowserTest |
35 virtual void SetUpCommandLine(CommandLine* command_line) { | 35 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
36 command_line->AppendSwitch(switches::kEnableCrxlessWebApps); | 36 command_line->AppendSwitch(switches::kEnableCrxlessWebApps); |
37 } | 37 } |
38 | 38 |
39 // content::NotificationObserver | 39 // content::NotificationObserver |
40 virtual void Observe(int type, | 40 virtual void Observe(int type, |
41 const content::NotificationSource& source, | 41 const content::NotificationSource& source, |
42 const content::NotificationDetails& details) { | 42 const content::NotificationDetails& details) OVERRIDE { |
43 if (type == chrome::NOTIFICATION_EXTENSION_INSTALLED) { | 43 if (type == chrome::NOTIFICATION_EXTENSION_INSTALLED) { |
44 const Extension* extension = | 44 const Extension* extension = |
45 content::Details<const Extension>(details).ptr(); | 45 content::Details<const Extension>(details).ptr(); |
46 if (extension->id() == expected_extension_id_) { | 46 if (extension->id() == expected_extension_id_) { |
47 installed_extension_ = extension; | 47 installed_extension_ = extension; |
48 MessageLoopForUI::current()->Quit(); | 48 MessageLoopForUI::current()->Quit(); |
49 } | 49 } |
50 } | 50 } |
51 } | 51 } |
52 }; | 52 }; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 ASSERT_EQ(3u, installed_extension_->icons().map().size()); | 85 ASSERT_EQ(3u, installed_extension_->icons().map().size()); |
86 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( | 86 EXPECT_EQ("icons/16.png", installed_extension_->icons().Get( |
87 16, ExtensionIconSet::MATCH_EXACTLY)); | 87 16, ExtensionIconSet::MATCH_EXACTLY)); |
88 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( | 88 EXPECT_EQ("icons/48.png", installed_extension_->icons().Get( |
89 48, ExtensionIconSet::MATCH_EXACTLY)); | 89 48, ExtensionIconSet::MATCH_EXACTLY)); |
90 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( | 90 EXPECT_EQ("icons/128.png", installed_extension_->icons().Get( |
91 128, ExtensionIconSet::MATCH_EXACTLY)); | 91 128, ExtensionIconSet::MATCH_EXACTLY)); |
92 } | 92 } |
93 | 93 |
94 } // namespace extensions | 94 } // namespace extensions |
OLD | NEW |