Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: chrome/browser/web_bluetooth_browsertest.cc

Issue 2437943002: Ship WebBluetooth out of origin trial (Closed)
Patch Set: fixed layout tests on Linux and Windows Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 using device::MockBluetoothAdapter; 24 using device::MockBluetoothAdapter;
25 using testing::Return; 25 using testing::Return;
26 26
27 typedef testing::NiceMock<MockBluetoothAdapter> NiceMockBluetoothAdapter; 27 typedef testing::NiceMock<MockBluetoothAdapter> NiceMockBluetoothAdapter;
28 28
29 namespace { 29 namespace {
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 // This is needed while Web Bluetooth is an Origin Trial, but can go away 34 command_line->AppendSwitch(
scheib 2016/10/21 01:02:10 comment as above.
juncai 2016/10/21 16:57:54 Done.
35 // once it ships globally. 35 switches::kEnableExperimentalWebPlatformFeatures);
36 command_line->AppendSwitch(switches::kEnableWebBluetooth);
37 InProcessBrowserTest::SetUpCommandLine(command_line); 36 InProcessBrowserTest::SetUpCommandLine(command_line);
38 } 37 }
39 38
40 void SetUpOnMainThread() override { 39 void SetUpOnMainThread() override {
41 // Navigate to a secure context. 40 // Navigate to a secure context.
42 embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data"); 41 embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
43 ASSERT_TRUE(embedded_test_server()->Start()); 42 ASSERT_TRUE(embedded_test_server()->Start());
44 ui_test_utils::NavigateToURL( 43 ui_test_utils::NavigateToURL(
45 browser(), 44 browser(),
46 embedded_test_server()->GetURL("localhost", "/simple_page.html")); 45 embedded_test_server()->GetURL("localhost", "/simple_page.html"));
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 " .then(() => { domAutomationController.send('Success'); }," 159 " .then(() => { domAutomationController.send('Success'); },"
161 " reason => {" 160 " reason => {"
162 " domAutomationController.send(reason.name + ': ' + reason.message);" 161 " domAutomationController.send(reason.name + ': ' + reason.message);"
163 " });", 162 " });",
164 &rejection)); 163 &rejection));
165 EXPECT_THAT(rejection, 164 EXPECT_THAT(rejection,
166 testing::MatchesRegex("SecurityError: .*blacklisted UUID.*")); 165 testing::MatchesRegex("SecurityError: .*blacklisted UUID.*"));
167 } 166 }
168 167
169 } // namespace 168 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698