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 "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" |
7 #include "extensions/common/error_utils.h" | 7 #include "extensions/common/error_utils.h" |
8 #include "extensions/common/feature_switch.h" | 8 #include "extensions/common/feature_switch.h" |
9 #include "extensions/common/manifest_constants.h" | 9 #include "extensions/common/manifest_constants.h" |
10 #include "extensions/common/manifest_handlers/options_page_info.h" | 10 #include "extensions/common/manifest_handlers/options_page_info.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 using namespace extensions; | 13 using namespace extensions; |
14 | 14 |
15 namespace errors = extensions::manifest_errors; | 15 namespace errors = extensions::manifest_errors; |
16 | 16 |
17 class OptionsPageManifestTest : public ExtensionManifestTest { | 17 class OptionsPageManifestTest : public ChromeManifestTest { |
18 }; | 18 }; |
19 | 19 |
20 TEST_F(OptionsPageManifestTest, OptionsPageInApps) { | 20 TEST_F(OptionsPageManifestTest, OptionsPageInApps) { |
21 // Allow options page with absolute URL in hosted apps. | 21 // Allow options page with absolute URL in hosted apps. |
22 scoped_refptr<Extension> extension = | 22 scoped_refptr<Extension> extension = |
23 LoadAndExpectSuccess("hosted_app_absolute_options.json"); | 23 LoadAndExpectSuccess("hosted_app_absolute_options.json"); |
24 EXPECT_EQ("http://example.com/options.html", | 24 EXPECT_EQ("http://example.com/options.html", |
25 OptionsPageInfo::GetOptionsPage(extension.get()).spec()); | 25 OptionsPageInfo::GetOptionsPage(extension.get()).spec()); |
26 | 26 |
27 extension = LoadAndExpectSuccess("platform_app_with_options_page.json"); | 27 extension = LoadAndExpectSuccess("platform_app_with_options_page.json"); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 extension = LoadAndExpectSuccess("options_ui_flags_false.json"); | 72 extension = LoadAndExpectSuccess("options_ui_flags_false.json"); |
73 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); | 73 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); |
74 EXPECT_FALSE(OptionsPageInfo::ShouldOpenInTab(extension.get())); | 74 EXPECT_FALSE(OptionsPageInfo::ShouldOpenInTab(extension.get())); |
75 | 75 |
76 // If chrome_style and open_in_tab are not set, they should be false. | 76 // If chrome_style and open_in_tab are not set, they should be false. |
77 extension = LoadAndExpectSuccess("options_ui_page_basic.json"); | 77 extension = LoadAndExpectSuccess("options_ui_page_basic.json"); |
78 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); | 78 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); |
79 EXPECT_FALSE(OptionsPageInfo::ShouldOpenInTab(extension.get())); | 79 EXPECT_FALSE(OptionsPageInfo::ShouldOpenInTab(extension.get())); |
80 } | 80 } |
OLD | NEW |