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

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

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 EXPECT_EQ("NotFoundError: Bluetooth adapter not available.", result); 71 EXPECT_EQ("NotFoundError: Bluetooth adapter not available.", result);
72 72
73 // Crash the renderer process. 73 // Crash the renderer process.
74 content::RenderProcessHost* process = web_contents_->GetRenderProcessHost(); 74 content::RenderProcessHost* process = web_contents_->GetRenderProcessHost();
75 content::RenderProcessHostWatcher crash_observer( 75 content::RenderProcessHostWatcher crash_observer(
76 process, content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 76 process, content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
77 process->Shutdown(0, false); 77 process->Shutdown(0, false);
78 crash_observer.Wait(); 78 crash_observer.Wait();
79 79
80 // Reload tab. 80 // Reload tab.
81 chrome::Reload(browser(), CURRENT_TAB); 81 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
82 content::WaitForLoadStop( 82 content::WaitForLoadStop(
83 browser()->tab_strip_model()->GetActiveWebContents()); 83 browser()->tab_strip_model()->GetActiveWebContents());
84 84
85 // Use Web Bluetooth again. 85 // Use Web Bluetooth again.
86 std::string result_after_crash; 86 std::string result_after_crash;
87 EXPECT_TRUE(content::ExecuteScriptAndExtractString( 87 EXPECT_TRUE(content::ExecuteScriptAndExtractString(
88 web_contents_, 88 web_contents_,
89 "navigator.bluetooth.requestDevice({filters: [{services: [0x180d]}]})" 89 "navigator.bluetooth.requestDevice({filters: [{services: [0x180d]}]})"
90 " .catch(e => domAutomationController.send(e.toString()));", 90 " .catch(e => domAutomationController.send(e.toString()));",
91 &result_after_crash)); 91 &result_after_crash));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 " .then(() => { domAutomationController.send('Success'); }," 145 " .then(() => { domAutomationController.send('Success'); },"
146 " reason => {" 146 " reason => {"
147 " domAutomationController.send(reason.name + ': ' + reason.message);" 147 " domAutomationController.send(reason.name + ': ' + reason.message);"
148 " });", 148 " });",
149 &rejection)); 149 &rejection));
150 EXPECT_THAT(rejection, 150 EXPECT_THAT(rejection,
151 testing::MatchesRegex("SecurityError: .*blacklisted UUID.*")); 151 testing::MatchesRegex("SecurityError: .*blacklisted UUID.*"));
152 } 152 }
153 153
154 } // namespace 154 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/usb/web_usb_detector.cc ('k') | chrome/test/base/browser_with_test_window_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698