| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.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" |
| 11 #include "chrome/test/chromedriver/chrome/status.h" |
| 11 #include "chrome/test/chromedriver/command_executor_impl.h" | 12 #include "chrome/test/chromedriver/command_executor_impl.h" |
| 12 #include "chrome/test/chromedriver/status.h" | |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 TEST(CommandExecutorImplTest, UnknownCommand) { | 15 TEST(CommandExecutorImplTest, UnknownCommand) { |
| 16 CommandExecutorImpl executor; | 16 CommandExecutorImpl executor; |
| 17 base::DictionaryValue empty_dict; | 17 base::DictionaryValue empty_dict; |
| 18 StatusCode status; | 18 StatusCode status; |
| 19 scoped_ptr<base::Value> value; | 19 scoped_ptr<base::Value> value; |
| 20 std::string session_id; | 20 std::string session_id; |
| 21 executor.ExecuteCommand("noSuchCommand", empty_dict, "session", | 21 executor.ExecuteCommand("noSuchCommand", empty_dict, "session", |
| 22 &status, &value, &session_id); | 22 &status, &value, &session_id); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 &status_code, &value, | 122 &status_code, &value, |
| 123 &out_session_id); | 123 &out_session_id); |
| 124 ASSERT_EQ(kUnknownError, status_code); | 124 ASSERT_EQ(kUnknownError, status_code); |
| 125 ASSERT_TRUE(value); | 125 ASSERT_TRUE(value); |
| 126 base::DictionaryValue* error; | 126 base::DictionaryValue* error; |
| 127 ASSERT_TRUE(value->GetAsDictionary(&error)); | 127 ASSERT_TRUE(value->GetAsDictionary(&error)); |
| 128 std::string message; | 128 std::string message; |
| 129 ASSERT_TRUE(error->GetString("message", &message)); | 129 ASSERT_TRUE(error->GetString("message", &message)); |
| 130 ASSERT_NE(std::string::npos, message.find("unknown error")); | 130 ASSERT_NE(std::string::npos, message.find("unknown error")); |
| 131 } | 131 } |
| OLD | NEW |