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

Unified Diff: chrome/test/chromedriver/chrome/recorder_devtools_client.h

Issue 883083002: [chromedriver] Add Network Conditions Override Manager and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix warning Created 5 years, 9 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: chrome/test/chromedriver/chrome/recorder_devtools_client.h
diff --git a/chrome/test/chromedriver/chrome/recorder_devtools_client.h b/chrome/test/chromedriver/chrome/recorder_devtools_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..f7e49d2f7cb2b31bb42a0ecd7ab89966f0ed7945
--- /dev/null
+++ b/chrome/test/chromedriver/chrome/recorder_devtools_client.h
@@ -0,0 +1,54 @@
+// Copyright (c) 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 CHROME_TEST_CHROMEDRIVER_CHROME_RECORDER_DEVTOOLS_CLIENT_H_
+#define CHROME_TEST_CHROMEDRIVER_CHROME_RECORDER_DEVTOOLS_CLIENT_H_
+
+#include <vector>
+
+#include "base/values.h"
+#include "chrome/test/chromedriver/chrome/stub_devtools_client.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+class Status;
+
+struct Command {
+ Command() {}
+ Command(const std::string& method, const base::DictionaryValue& params)
+ : method(method) {
+ this->params.MergeDictionary(&params);
+ }
+ Command(const Command& command) {
+ *this = command;
+ }
+ Command& operator=(const Command& command) {
+ method = command.method;
+ params.Clear();
+ params.MergeDictionary(&command.params);
+ return *this;
+ }
+ ~Command() {}
+
+ std::string method;
+ base::DictionaryValue params;
+};
+
+class RecorderDevToolsClient : public StubDevToolsClient {
+ public:
+ RecorderDevToolsClient();
+ ~RecorderDevToolsClient() override;
+
+ // Overridden from StubDevToolsClient:
+ Status SendCommandAndGetResult(
+ const std::string& method,
+ const base::DictionaryValue& params,
+ scoped_ptr<base::DictionaryValue>* result) override;
+
+ std::vector<Command> commands_;
+};
+
+#endif // CHROME_TEST_CHROMEDRIVER_CHROME_RECORDER_DEVTOOLS_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698