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

Side by Side Diff: content/shell/browser/layout_test/blink_test_controller.h

Issue 2658473002: Refactor BluetoothAllowedDevicesMap (Closed)
Patch Set: updated test code Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <ostream> 10 #include <ostream>
(...skipping 20 matching lines...) Expand all
31 #include "ui/gfx/geometry/size.h" 31 #include "ui/gfx/geometry/size.h"
32 32
33 #if defined(OS_ANDROID) 33 #if defined(OS_ANDROID)
34 #include "base/threading/thread_restrictions.h" 34 #include "base/threading/thread_restrictions.h"
35 #endif 35 #endif
36 36
37 class SkBitmap; 37 class SkBitmap;
38 38
39 namespace content { 39 namespace content {
40 40
41 class BluetoothAllowedDevicesMapBase;
42 class BrowserContext;
41 class LayoutTestBluetoothChooserFactory; 43 class LayoutTestBluetoothChooserFactory;
42 class LayoutTestDevToolsFrontend; 44 class LayoutTestDevToolsFrontend;
43 class RenderFrameHost; 45 class RenderFrameHost;
44 class RenderProcessHost; 46 class RenderProcessHost;
45 class Shell; 47 class Shell;
46 48
47 #if defined(OS_ANDROID) 49 #if defined(OS_ANDROID)
48 // Android uses a nested message loop for running layout tests because the 50 // Android uses a nested message loop for running layout tests because the
49 // default message loop, provided by the system, does not offer a blocking 51 // default message loop, provided by the system, does not offer a blocking
50 // Run() method. The loop itself, implemented as NestedMessagePumpAndroid, 52 // Run() method. The loop itself, implemented as NestedMessagePumpAndroid,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void HandleNewRenderFrameHost(RenderFrameHost* frame); 145 void HandleNewRenderFrameHost(RenderFrameHost* frame);
144 146
145 void SetTempPath(const base::FilePath& temp_path); 147 void SetTempPath(const base::FilePath& temp_path);
146 void RendererUnresponsive(); 148 void RendererUnresponsive();
147 void OverrideWebkitPrefs(WebPreferences* prefs); 149 void OverrideWebkitPrefs(WebPreferences* prefs);
148 void OpenURL(const GURL& url); 150 void OpenURL(const GURL& url);
149 bool IsMainWindow(WebContents* web_contents) const; 151 bool IsMainWindow(WebContents* web_contents) const;
150 std::unique_ptr<BluetoothChooser> RunBluetoothChooser( 152 std::unique_ptr<BluetoothChooser> RunBluetoothChooser(
151 RenderFrameHost* frame, 153 RenderFrameHost* frame,
152 const BluetoothChooser::EventHandler& event_handler); 154 const BluetoothChooser::EventHandler& event_handler);
155 BluetoothAllowedDevicesMapBase* GetBluetoothAllowedDevicesMap(
156 BrowserContext* browser_context);
153 157
154 BlinkTestResultPrinter* printer() { return printer_.get(); } 158 BlinkTestResultPrinter* printer() { return printer_.get(); }
155 void set_printer(BlinkTestResultPrinter* printer) { printer_.reset(printer); } 159 void set_printer(BlinkTestResultPrinter* printer) { printer_.reset(printer); }
156 160
157 void DevToolsProcessCrashed(); 161 void DevToolsProcessCrashed();
158 162
159 // WebContentsObserver implementation. 163 // WebContentsObserver implementation.
160 bool OnMessageReceived(const IPC::Message& message) override; 164 bool OnMessageReceived(const IPC::Message& message) override;
161 bool OnMessageReceived(const IPC::Message& message, 165 bool OnMessageReceived(const IPC::Message& message,
162 RenderFrameHost* render_frame_host) override; 166 RenderFrameHost* render_frame_host) override;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 void OnLoadURLForFrame(const GURL& url, const std::string& frame_name); 214 void OnLoadURLForFrame(const GURL& url, const std::string& frame_name);
211 void OnCaptureSessionHistory(); 215 void OnCaptureSessionHistory();
212 void OnCloseRemainingWindows(); 216 void OnCloseRemainingWindows();
213 void OnResetDone(); 217 void OnResetDone();
214 void OnLeakDetectionDone(const content::LeakDetectionResult& result); 218 void OnLeakDetectionDone(const content::LeakDetectionResult& result);
215 void OnSetBluetoothManualChooser(bool enable); 219 void OnSetBluetoothManualChooser(bool enable);
216 void OnGetBluetoothManualChooserEvents(); 220 void OnGetBluetoothManualChooserEvents();
217 void OnSendBluetoothManualChooserEvent(const std::string& event, 221 void OnSendBluetoothManualChooserEvent(const std::string& event,
218 const std::string& argument); 222 const std::string& argument);
219 mojom::LayoutTestControl* GetLayoutTestControlPtr(RenderFrameHost* frame); 223 mojom::LayoutTestControl* GetLayoutTestControlPtr(RenderFrameHost* frame);
224 void OnResetBluetoothAllowedDevicesMap();
220 225
221 std::unique_ptr<BlinkTestResultPrinter> printer_; 226 std::unique_ptr<BlinkTestResultPrinter> printer_;
222 227
223 base::FilePath current_working_directory_; 228 base::FilePath current_working_directory_;
224 base::FilePath temp_path_; 229 base::FilePath temp_path_;
225 230
226 Shell* main_window_; 231 Shell* main_window_;
227 232
228 // The PID of the render process of the render view host of main_window_. 233 // The PID of the render process of the render view host of main_window_.
229 int current_pid_; 234 int current_pid_;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 287
283 // Map from one frame to one mojo pipe. 288 // Map from one frame to one mojo pipe.
284 std::map<RenderFrameHost*, mojom::LayoutTestControlAssociatedPtr> 289 std::map<RenderFrameHost*, mojom::LayoutTestControlAssociatedPtr>
285 layout_test_control_map_; 290 layout_test_control_map_;
286 #if defined(OS_ANDROID) 291 #if defined(OS_ANDROID)
287 // Because of the nested message pump implementation, Android needs to allow 292 // Because of the nested message pump implementation, Android needs to allow
288 // waiting on the UI thread while layout tests are being ran. 293 // waiting on the UI thread while layout tests are being ran.
289 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; 294 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_;
290 #endif 295 #endif
291 296
297 std::map<BrowserContext*, std::unique_ptr<BluetoothAllowedDevicesMapBase>>
298 browser_contenxt_to_bluetooth_allowed_devices_map_;
299
292 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); 300 DISALLOW_COPY_AND_ASSIGN(BlinkTestController);
293 }; 301 };
294 302
295 } // namespace content 303 } // namespace content
296 304
297 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ 305 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698