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

Side by Side Diff: chrome/test/chromedriver/chrome_impl_unittest.cc

Issue 11975003: [ChromeDriver] Add support for attaching multiple DevToolsEventListeners to a DevToolsClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added OVERRIDE. Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/chromedriver/chrome_impl.cc ('k') | chrome/test/chromedriver/devtools_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <list> 5 #include <list>
6 #include <string> 6 #include <string>
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 virtual Status SendCommandAndGetResult( 89 virtual Status SendCommandAndGetResult(
90 const std::string& method, 90 const std::string& method,
91 const base::DictionaryValue& params, 91 const base::DictionaryValue& params,
92 scoped_ptr<base::DictionaryValue>* result) OVERRIDE { 92 scoped_ptr<base::DictionaryValue>* result) OVERRIDE {
93 if (status_.IsError()) 93 if (status_.IsError())
94 return status_; 94 return status_;
95 result->reset(result_.DeepCopy()); 95 result->reset(result_.DeepCopy());
96 return Status(kOk); 96 return Status(kOk);
97 } 97 }
98 virtual void AddListener(DevToolsEventListener* listener) OVERRIDE {}
98 99
99 private: 100 private:
100 Status status_; 101 Status status_;
101 base::DictionaryValue result_; 102 base::DictionaryValue result_;
102 }; 103 };
103 104
104 void AssertEvalFails(const base::DictionaryValue& command_result) { 105 void AssertEvalFails(const base::DictionaryValue& command_result) {
105 scoped_ptr<base::DictionaryValue> result; 106 scoped_ptr<base::DictionaryValue> result;
106 FakeDevToolsClient client; 107 FakeDevToolsClient client;
107 client.set_result(command_result); 108 client.set_result(command_result);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 FakeDevToolsClient client; 227 FakeDevToolsClient client;
227 base::DictionaryValue dict; 228 base::DictionaryValue dict;
228 dict.SetBoolean("wasThrown", false); 229 dict.SetBoolean("wasThrown", false);
229 dict.SetString("result.objectId", "id"); 230 dict.SetString("result.objectId", "id");
230 client.set_result(dict); 231 client.set_result(dict);
231 std::string object_id; 232 std::string object_id;
232 ASSERT_TRUE(internal::EvaluateScriptAndGetObject( 233 ASSERT_TRUE(internal::EvaluateScriptAndGetObject(
233 &client, 0, "", &object_id).IsOk()); 234 &client, 0, "", &object_id).IsOk());
234 ASSERT_STREQ("id", object_id.c_str()); 235 ASSERT_STREQ("id", object_id.c_str());
235 } 236 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome_impl.cc ('k') | chrome/test/chromedriver/devtools_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698