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 // This file contains browsertests for Web Bluetooth that depend on behavior | 5 // This file contains browsertests for Web Bluetooth that depend on behavior |
6 // defined in chrome/, not just in content/. | 6 // defined in chrome/, not just in content/. |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "chrome/browser/permissions/permission_context_base.h" | 10 #include "chrome/browser/permissions/permission_context_base.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 class WebBluetoothTest : public InProcessBrowserTest { | 31 class WebBluetoothTest : public InProcessBrowserTest { |
32 protected: | 32 protected: |
33 void SetUpCommandLine(base::CommandLine* command_line) override { | 33 void SetUpCommandLine(base::CommandLine* command_line) override { |
34 // TODO(juncai): Remove this switch once Web Bluetooth is supported on Linux | 34 // TODO(juncai): Remove this switch once Web Bluetooth is supported on Linux |
35 // and Windows. | 35 // and Windows. |
36 // https://crbug.com/570344 | 36 // https://crbug.com/570344 |
37 // https://crbug.com/507419 | 37 // https://crbug.com/507419 |
38 command_line->AppendSwitch( | 38 command_line->AppendSwitch( |
39 switches::kEnableExperimentalWebPlatformFeatures); | 39 switches::kEnableExperimentalWebPlatformFeatures); |
40 InProcessBrowserTest::SetUpCommandLine(command_line); | |
41 } | 40 } |
42 | 41 |
43 void SetUpOnMainThread() override { | 42 void SetUpOnMainThread() override { |
44 // Navigate to a secure context. | 43 // Navigate to a secure context. |
45 embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data"); | 44 embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data"); |
46 ASSERT_TRUE(embedded_test_server()->Start()); | 45 ASSERT_TRUE(embedded_test_server()->Start()); |
47 ui_test_utils::NavigateToURL( | 46 ui_test_utils::NavigateToURL( |
48 browser(), | 47 browser(), |
49 embedded_test_server()->GetURL("localhost", "/simple_page.html")); | 48 embedded_test_server()->GetURL("localhost", "/simple_page.html")); |
50 web_contents_ = browser()->tab_strip_model()->GetActiveWebContents(); | 49 web_contents_ = browser()->tab_strip_model()->GetActiveWebContents(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 " .then(() => { domAutomationController.send('Success'); }," | 171 " .then(() => { domAutomationController.send('Success'); }," |
173 " reason => {" | 172 " reason => {" |
174 " domAutomationController.send(reason.name + ': ' + reason.message);" | 173 " domAutomationController.send(reason.name + ': ' + reason.message);" |
175 " });", | 174 " });", |
176 &rejection)); | 175 &rejection)); |
177 EXPECT_THAT(rejection, | 176 EXPECT_THAT(rejection, |
178 testing::MatchesRegex("SecurityError: .*blocklisted UUID.*")); | 177 testing::MatchesRegex("SecurityError: .*blocklisted UUID.*")); |
179 } | 178 } |
180 | 179 |
181 } // namespace | 180 } // namespace |
OLD | NEW |