OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "extensions/common/switches.h" | 7 #include "extensions/common/switches.h" |
8 | 8 |
9 namespace extensions { | 9 namespace extensions { |
10 | 10 |
11 // And end-to-end test for extension APIs using native bindings. | 11 // And end-to-end test for extension APIs using native bindings. |
12 class NativeBindingsApiTest : public ExtensionApiTest { | 12 class NativeBindingsApiTest : public ExtensionApiTest { |
13 public: | 13 public: |
14 NativeBindingsApiTest() {} | 14 NativeBindingsApiTest() {} |
15 ~NativeBindingsApiTest() override {} | 15 ~NativeBindingsApiTest() override {} |
16 | 16 |
17 void SetUpCommandLine(base::CommandLine* command_line) override { | 17 void SetUpCommandLine(base::CommandLine* command_line) override { |
18 ExtensionApiTest::SetUpCommandLine(command_line); | 18 ExtensionApiTest::SetUpCommandLine(command_line); |
19 // Note: We don't use a FeatureSwitch::ScopedOverride here because we need | 19 // Note: We don't use a FeatureSwitch::ScopedOverride here because we need |
20 // the switch to be propogated to the renderer, which doesn't happen with | 20 // the switch to be propogated to the renderer, which doesn't happen with |
21 // a ScopedOverride. | 21 // a ScopedOverride. |
22 command_line->AppendSwitchASCII(switches::kNativeCrxBindings, "1"); | 22 command_line->AppendSwitchASCII(switches::kNativeCrxBindings, "1"); |
23 } | 23 } |
24 | 24 |
25 private: | 25 private: |
26 DISALLOW_COPY_AND_ASSIGN(NativeBindingsApiTest); | 26 DISALLOW_COPY_AND_ASSIGN(NativeBindingsApiTest); |
27 }; | 27 }; |
28 | 28 |
29 IN_PROC_BROWSER_TEST_F(NativeBindingsApiTest, SimpleEndToEndTest) { | 29 IN_PROC_BROWSER_TEST_F(NativeBindingsApiTest, SimpleEndToEndTest) { |
| 30 embedded_test_server()->ServeFilesFromDirectory(test_data_dir_); |
| 31 ASSERT_TRUE(StartEmbeddedTestServer()); |
30 ASSERT_TRUE(RunExtensionTest("native_bindings")) << message_; | 32 ASSERT_TRUE(RunExtensionTest("native_bindings")) << message_; |
31 } | 33 } |
32 | 34 |
33 } // namespace extensions | 35 } // namespace extensions |
OLD | NEW |