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 "base/values.h" |
11 #include "chrome/common/automation_constants.h" | 11 #include "chrome/common/automation_constants.h" |
12 #include "chrome/common/automation_events.h" | 12 #include "chrome/common/automation_events.h" |
13 #include "chrome/test/base/chrome_render_view_test.h" | 13 #include "chrome/test/base/chrome_render_view_test.h" |
14 #include "chrome/renderer/automation/automation_renderer_helper.h" | 14 #include "chrome/renderer/automation/automation_renderer_helper.h" |
15 #include "content/public/renderer/render_view.h" | 15 #include "content/public/renderer/render_view.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 17 #include "third_party/WebKit/public/platform/WebSize.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const char kThreeBoxesHTML[] = | 22 const char kThreeBoxesHTML[] = |
23 "<style> * { margin:0px; padding:0px } </style>" | 23 "<style> * { margin:0px; padding:0px } </style>" |
24 "<body>" | 24 "<body>" |
25 " <div style='background:red;width:100;height:100'></div>" | 25 " <div style='background:red;width:100;height:100'></div>" |
26 " <div style='background:green;width:100;height:100'></div>" | 26 " <div style='background:green;width:100;height:100'></div>" |
27 " <div style='background:blue;width:100;height:100'></div>" | 27 " <div style='background:blue;width:100;height:100'></div>" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 scoped_ptr<base::DictionaryValue> result; | 115 scoped_ptr<base::DictionaryValue> result; |
116 std::string error; | 116 std::string error; |
117 ASSERT_FALSE(helper.EvaluateScriptChain(script_chain, &result, &error)); | 117 ASSERT_FALSE(helper.EvaluateScriptChain(script_chain, &result, &error)); |
118 scoped_ptr<base::Value> value(base::JSONReader::Read(error)); | 118 scoped_ptr<base::Value> value(base::JSONReader::Read(error)); |
119 base::DictionaryValue* dict; | 119 base::DictionaryValue* dict; |
120 ASSERT_TRUE(value->GetAsDictionary(&dict)); | 120 ASSERT_TRUE(value->GetAsDictionary(&dict)); |
121 std::string msg; | 121 std::string msg; |
122 ASSERT_TRUE(dict->GetString("msg", &msg)); | 122 ASSERT_TRUE(dict->GetString("msg", &msg)); |
123 EXPECT_STREQ("some msg", msg.c_str()); | 123 EXPECT_STREQ("some msg", msg.c_str()); |
124 } | 124 } |
OLD | NEW |