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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/md5.h" | 8 #include "base/md5.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" |
10 #include "chrome/common/automation_constants.h" | 11 #include "chrome/common/automation_constants.h" |
11 #include "chrome/common/automation_events.h" | 12 #include "chrome/common/automation_events.h" |
12 #include "chrome/test/base/chrome_render_view_test.h" | 13 #include "chrome/test/base/chrome_render_view_test.h" |
13 #include "chrome/renderer/automation/automation_renderer_helper.h" | 14 #include "chrome/renderer/automation/automation_renderer_helper.h" |
14 #include "content/public/renderer/render_view.h" | 15 #include "content/public/renderer/render_view.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
18 | 19 |
19 namespace { | 20 namespace { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 scoped_ptr<base::DictionaryValue> result; | 114 scoped_ptr<base::DictionaryValue> result; |
114 std::string error; | 115 std::string error; |
115 ASSERT_FALSE(helper.EvaluateScriptChain(script_chain, &result, &error)); | 116 ASSERT_FALSE(helper.EvaluateScriptChain(script_chain, &result, &error)); |
116 scoped_ptr<base::Value> value(base::JSONReader::Read(error)); | 117 scoped_ptr<base::Value> value(base::JSONReader::Read(error)); |
117 base::DictionaryValue* dict; | 118 base::DictionaryValue* dict; |
118 ASSERT_TRUE(value->GetAsDictionary(&dict)); | 119 ASSERT_TRUE(value->GetAsDictionary(&dict)); |
119 std::string msg; | 120 std::string msg; |
120 ASSERT_TRUE(dict->GetString("msg", &msg)); | 121 ASSERT_TRUE(dict->GetString("msg", &msg)); |
121 EXPECT_STREQ("some msg", msg.c_str()); | 122 EXPECT_STREQ("some msg", msg.c_str()); |
122 } | 123 } |
OLD | NEW |