OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "chrome/common/extensions/api/extension_action/action_info.h" | 8 #include "chrome/common/extensions/api/extension_action/action_info.h" |
9 #include "chrome/common/extensions/api/page_launcher/page_launcher_handler.h" | |
10 #include "chrome/common/extensions/background_info.h" | 9 #include "chrome/common/extensions/background_info.h" |
11 #include "chrome/common/extensions/extension_icon_set.h" | 10 #include "chrome/common/extensions/extension_icon_set.h" |
12 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 11 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
13 | 12 |
14 namespace extensions { | 13 namespace extensions { |
15 | 14 |
16 class PageLauncherManifestTest : public ExtensionManifestTest { | 15 class PageLauncherManifestTest : public ExtensionManifestTest { |
17 virtual void SetUp() OVERRIDE { | 16 protected: |
18 ExtensionManifestTest::SetUp(); | |
19 (new PageLauncherHandler)->Register(); | |
20 // Required to be recognized as a platform app. | |
21 (new BackgroundManifestHandler)->Register(); | |
22 } | |
23 | |
24 virtual char const* test_data_dir() OVERRIDE { | 17 virtual char const* test_data_dir() OVERRIDE { |
25 return "page_launcher"; | 18 return "page_launcher"; |
26 } | 19 } |
27 }; | 20 }; |
28 | 21 |
29 TEST_F(PageLauncherManifestTest, AppPageLauncherNotPresent) { | 22 TEST_F(PageLauncherManifestTest, AppPageLauncherNotPresent) { |
30 scoped_refptr<Extension> extension = | 23 scoped_refptr<Extension> extension = |
31 LoadAndExpectSuccess("app_page_launcher_not_present.json"); | 24 LoadAndExpectSuccess("app_page_launcher_not_present.json"); |
32 const ActionInfo* page_launcher_info = | 25 const ActionInfo* page_launcher_info = |
33 ActionInfo::GetPageLauncherInfo(extension.get()); | 26 ActionInfo::GetPageLauncherInfo(extension.get()); |
(...skipping 12 matching lines...) Expand all Loading... |
46 | 39 |
47 TEST_F(PageLauncherManifestTest, ExtensionWithPageLauncher) { | 40 TEST_F(PageLauncherManifestTest, ExtensionWithPageLauncher) { |
48 scoped_refptr<Extension> extension = | 41 scoped_refptr<Extension> extension = |
49 LoadAndExpectSuccess("extension_page_launcher_present.json"); | 42 LoadAndExpectSuccess("extension_page_launcher_present.json"); |
50 const ActionInfo* page_launcher_info = | 43 const ActionInfo* page_launcher_info = |
51 ActionInfo::GetPageLauncherInfo(extension.get()); | 44 ActionInfo::GetPageLauncherInfo(extension.get()); |
52 ASSERT_EQ(NULL, page_launcher_info); | 45 ASSERT_EQ(NULL, page_launcher_info); |
53 } | 46 } |
54 | 47 |
55 } // namespace extensions | 48 } // namespace extensions |
OLD | NEW |