| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/test/webdriver/commands/appcache_status_command.h" | 5 #include "chrome/test/webdriver/commands/appcache_status_command.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/test/webdriver/commands/response.h" | 9 #include "chrome/test/webdriver/commands/response.h" |
| 10 #include "chrome/test/webdriver/webdriver_error.h" | 10 #include "chrome/test/webdriver/webdriver_error.h" |
| 11 #include "chrome/test/webdriver/webdriver_session.h" | 11 #include "chrome/test/webdriver/webdriver_session.h" |
| 12 | 12 |
| 13 namespace webdriver { | 13 namespace webdriver { |
| 14 | 14 |
| 15 AppCacheStatusCommand::AppCacheStatusCommand( | 15 AppCacheStatusCommand::AppCacheStatusCommand( |
| 16 const std::vector<std::string>& path_segments, | 16 const std::vector<std::string>& path_segments, |
| 17 const DictionaryValue* const parameters) | 17 DictionaryValue* const parameters) |
| 18 : WebDriverCommand(path_segments, parameters) {} | 18 : WebDriverCommand(path_segments, parameters) {} |
| 19 | 19 |
| 20 AppCacheStatusCommand::~AppCacheStatusCommand() {} | 20 AppCacheStatusCommand::~AppCacheStatusCommand() {} |
| 21 | 21 |
| 22 bool AppCacheStatusCommand::DoesGet() { | 22 bool AppCacheStatusCommand::DoesGet() { |
| 23 return true; | 23 return true; |
| 24 } | 24 } |
| 25 | 25 |
| 26 void AppCacheStatusCommand::ExecuteGet(Response* const response) { | 26 void AppCacheStatusCommand::ExecuteGet(Response* const response) { |
| 27 int status; | 27 int status; |
| 28 Error* error = session_->GetAppCacheStatus(&status); | 28 Error* error = session_->GetAppCacheStatus(&status); |
| 29 if (error) { | 29 if (error) { |
| 30 response->SetError(error); | 30 response->SetError(error); |
| 31 return; | 31 return; |
| 32 } | 32 } |
| 33 response->SetValue(new base::FundamentalValue(status)); | 33 response->SetValue(new base::FundamentalValue(status)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace webdriver | 36 } // namespace webdriver |
| OLD | NEW |