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

Side by Side Diff: chrome/test/webdriver/commands/screenshot_command.cc

Issue 5572001: Send screenshots back to the client for debugging (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: for review Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/webdriver/commands/screenshot_command.h"
6
7 #include <string>
8 #include <vector>
9
10 #include "base/values.h"
11 #include "chrome/test/webdriver/error_codes.h"
12 #include "chrome/test/webdriver/session.h"
13 #include "chrome/test/webdriver/commands/response.h"
kkania 2011/02/24 22:05:02 this include should go above the error_codes one
Joe 2011/03/02 02:21:25 Done.
14
15 namespace webdriver {
16
17 ScreenshotCommand::ScreenshotCommand(const std::vector<std::string>& ps,
18 const DictionaryValue* const parameters)
19 : WebDriverCommand(ps, parameters) {}
20
21 ScreenshotCommand::~ScreenshotCommand() {}
22
23 bool ScreenshotCommand::DoesGet() {
24 return true;
25 }
26
27 void ScreenshotCommand::ExecuteGet(Response* const response) {
28 std::string screenshot;
29 if (!session_->ScreenshotAsBase64(&screenshot)) {
30 SET_WEBDRIVER_ERROR(response, "Screenshot of current page failed",
31 kInternalServerError);
32 return;
33 }
34
35 response->SetValue(new StringValue(screenshot));
36 response->SetStatus(kSuccess);
37 }
38
39 } // namespace webdriver
40
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698