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

Side by Side Diff: content/browser/devtools/protocol/devtools_protocol_browsertest.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 #include "base/base64.h" 5 #include "base/base64.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/public/browser/devtools_agent_host.h" 10 #include "content/public/browser/devtools_agent_host.h"
(...skipping 21 matching lines...) Expand all
32 protected: 32 protected:
33 void SendCommand(const std::string& method, 33 void SendCommand(const std::string& method,
34 scoped_ptr<base::DictionaryValue> params) { 34 scoped_ptr<base::DictionaryValue> params) {
35 base::DictionaryValue command; 35 base::DictionaryValue command;
36 command.SetInteger(kIdParam, 1); 36 command.SetInteger(kIdParam, 1);
37 command.SetString(kMethodParam, method); 37 command.SetString(kMethodParam, method);
38 if (params) 38 if (params)
39 command.Set(kParamsParam, params.release()); 39 command.Set(kParamsParam, params.release());
40 40
41 std::string json_command; 41 std::string json_command;
42 base::JSONWriter::Write(&command, &json_command); 42 base::JSONWriter::Write(command, &json_command);
43 agent_host_->DispatchProtocolMessage(json_command); 43 agent_host_->DispatchProtocolMessage(json_command);
44 base::MessageLoop::current()->Run(); 44 base::MessageLoop::current()->Run();
45 } 45 }
46 46
47 bool HasValue(const std::string& path) { 47 bool HasValue(const std::string& path) {
48 base::Value* value = 0; 48 base::Value* value = 0;
49 return result_->Get(path, &value); 49 return result_->Get(path, &value);
50 } 50 }
51 51
52 bool HasListItem(const std::string& path_to_list, 52 bool HasListItem(const std::string& path_to_list,
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // new value of |document.body.scrollTop| will depend on the screen dimensions 255 // new value of |document.body.scrollTop| will depend on the screen dimensions
256 // of the device that we're testing on, but in any case it should be greater 256 // of the device that we're testing on, but in any case it should be greater
257 // than 0. 257 // than 0.
258 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 258 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
259 shell()->web_contents(), 259 shell()->web_contents(),
260 "domAutomationController.send(document.body.scrollTop)", &scroll_top)); 260 "domAutomationController.send(document.body.scrollTop)", &scroll_top));
261 ASSERT_GT(scroll_top, 0); 261 ASSERT_GT(scroll_top, 0);
262 } 262 }
263 263
264 } // namespace content 264 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.cc ('k') | content/browser/devtools/protocol/devtools_protocol_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698