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

Unified Diff: content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h

Issue 1325953002: Add functions to let tests read and control the Bluetooth chooser state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Add a forgotten semicolon. :-/ Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h b/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f83f853ffca19caca1f077a3b0bbb3397e9dc63
--- /dev/null
+++ b/content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_H_
+#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_H_
+
+#include "content/public/browser/bluetooth_chooser.h"
+
+#include <set>
+#include <vector>
+
+#include "base/memory/weak_ptr.h"
+#include "content/public/browser/bluetooth_chooser.h"
+
+class GURL;
+
+namespace content {
+
+class WebContents;
+
+class LayoutTestBluetoothChooserFactory {
+ public:
+ LayoutTestBluetoothChooserFactory();
+ ~LayoutTestBluetoothChooserFactory();
+
+ scoped_ptr<BluetoothChooser> RunBluetoothChooser(
+ WebContents* web_contents,
+ const BluetoothChooser::EventHandler& event_handler,
+ const GURL& origin);
+
+ std::vector<std::string> GetAndResetEvents();
+
+ void SendEvent(BluetoothChooser::Event event, const std::string& device_id);
+
+ private:
+ class Chooser;
+
+ std::vector<std::string> events_;
+
+ // Contains the set of live choosers, in order to send them events.
+ std::set<Chooser*> choosers_;
+
+ base::WeakPtrFactory<LayoutTestBluetoothChooserFactory> weak_this_;
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_CHOOSER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698