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/chrome_manifest_test.h" | 6 #include "chrome/common/extensions/manifest_tests/extension_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 ChromeManifestTest { | 17 class OptionsPageManifestTest : public ExtensionManifestTest { |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); | 97 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); |
98 | 98 |
99 extension = LoadAndExpectSuccess("options_ui_flags_false.json"); | 99 extension = LoadAndExpectSuccess("options_ui_flags_false.json"); |
100 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); | 100 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); |
101 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); | 101 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); |
102 | 102 |
103 extension = LoadAndExpectSuccess("options_ui_page_basic.json"); | 103 extension = LoadAndExpectSuccess("options_ui_page_basic.json"); |
104 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); | 104 EXPECT_FALSE(OptionsPageInfo::ShouldUseChromeStyle(extension.get())); |
105 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); | 105 EXPECT_TRUE(OptionsPageInfo::ShouldOpenInTab(extension.get())); |
106 } | 106 } |
OLD | NEW |