[email protected] | 31d71b0 | 2012-01-26 03:42:31 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 9b4c6cd | 2012-08-20 10:47:45 | [diff] [blame] | 5 | #include "content/shell/webkit_test_runner.h" |
[email protected] | 31d71b0 | 2012-01-26 03:42:31 | [diff] [blame] | 6 | |
[email protected] | 0c5f222 | 2013-02-20 11:26:19 | [diff] [blame] | 7 | #include <algorithm> |
[email protected] | 833b700d | 2013-02-18 19:43:00 | [diff] [blame] | 8 | #include <clocale> |
[email protected] | b9fad24c | 2012-11-15 08:22:10 | [diff] [blame] | 9 | #include <cmath> |
| 10 | |
[email protected] | 09ec9f9 | 2012-12-17 09:46:36 | [diff] [blame] | 11 | #include "base/base64.h" |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 12 | #include "base/debug/debugger.h" |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 13 | #include "base/md5.h" |
[email protected] | e225b92 | 2012-08-18 01:43:04 | [diff] [blame] | 14 | #include "base/memory/scoped_ptr.h" |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 15 | #include "base/message_loop.h" |
[email protected] | 0c5f222 | 2013-02-20 11:26:19 | [diff] [blame] | 16 | #include "base/string_util.h" |
[email protected] | c272c5b | 2012-06-06 09:01:06 | [diff] [blame] | 17 | #include "base/stringprintf.h" |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 18 | #include "base/sys_string_conversions.h" |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 19 | #include "base/time.h" |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 20 | #include "base/utf_string_conversions.h" |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 21 | #include "content/public/renderer/render_view.h" |
[email protected] | f322356c | 2013-03-01 07:54:02 | [diff] [blame] | 22 | #include "content/public/renderer/render_view_visitor.h" |
[email protected] | e519692 | 2012-12-11 22:18:25 | [diff] [blame] | 23 | #include "content/public/test/layouttest_support.h" |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 24 | #include "content/shell/shell_messages.h" |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 25 | #include "content/shell/shell_render_process_observer.h" |
[email protected] | 55915a7 | 2012-12-18 11:55:25 | [diff] [blame] | 26 | #include "content/shell/webkit_test_helpers.h" |
[email protected] | 9d9ec98 | 2013-01-10 18:53:39 | [diff] [blame] | 27 | #include "net/base/net_errors.h" |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 28 | #include "net/base/net_util.h" |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 29 | #include "skia/ext/platform_canvas.h" |
[email protected] | 2a58eb1 | 2012-12-18 07:56:40 | [diff] [blame] | 30 | #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
[email protected] | 87884c4 | 2013-01-10 01:56:27 | [diff] [blame] | 31 | #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" |
| 32 | #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
| 33 | #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 34 | #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| 35 | #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
[email protected] | 9d9ec98 | 2013-01-10 18:53:39 | [diff] [blame] | 36 | #include "third_party/WebKit/Source/Platform/chromium/public/WebURLError.h" |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 37 | #include "third_party/WebKit/Source/Platform/chromium/public/WebURLResponse.h" |
[email protected] | 893fc636 | 2013-02-18 13:24:05 | [diff] [blame] | 38 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebArrayBufferView.h" |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 39 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 40 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
[email protected] | 001841c9 | 2012-12-11 17:00:13 | [diff] [blame] | 41 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgent.h" |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 42 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientation.h" |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 43 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 44 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 45 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 46 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h" |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 47 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 48 | #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 49 | #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTask.h" |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 50 | #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h" |
[email protected] | b9fad24c | 2012-11-15 08:22:10 | [diff] [blame] | 51 | #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h" |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 52 | #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h" |
[email protected] | c24b4022 | 2013-02-20 11:45:42 | [diff] [blame] | 53 | #include "ui/gfx/rect.h" |
[email protected] | 984a5f7 | 2012-12-13 21:41:50 | [diff] [blame] | 54 | #include "webkit/base/file_path_string_conversions.h" |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 55 | #include "webkit/glue/glue_serialize.h" |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 56 | #include "webkit/glue/webkit_glue.h" |
[email protected] | 324825d | 2012-11-30 12:37:15 | [diff] [blame] | 57 | #include "webkit/glue/webpreferences.h" |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 58 | |
[email protected] | 2a58eb1 | 2012-12-18 07:56:40 | [diff] [blame] | 59 | using WebKit::Platform; |
[email protected] | 893fc636 | 2013-02-18 13:24:05 | [diff] [blame] | 60 | using WebKit::WebArrayBufferView; |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 61 | using WebKit::WebContextMenuData; |
[email protected] | 001841c9 | 2012-12-11 17:00:13 | [diff] [blame] | 62 | using WebKit::WebDevToolsAgent; |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 63 | using WebKit::WebDeviceOrientation; |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 64 | using WebKit::WebElement; |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 65 | using WebKit::WebFrame; |
| 66 | using WebKit::WebGamepads; |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 67 | using WebKit::WebHistoryItem; |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 68 | using WebKit::WebRect; |
[email protected] | c272c5b | 2012-06-06 09:01:06 | [diff] [blame] | 69 | using WebKit::WebSize; |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 70 | using WebKit::WebString; |
[email protected] | 09ec9f9 | 2012-12-17 09:46:36 | [diff] [blame] | 71 | using WebKit::WebURL; |
[email protected] | 9d9ec98 | 2013-01-10 18:53:39 | [diff] [blame] | 72 | using WebKit::WebURLError; |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 73 | using WebKit::WebVector; |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 74 | using WebKit::WebView; |
[email protected] | b3dbcb5e | 2012-12-17 00:16:37 | [diff] [blame] | 75 | using WebTestRunner::WebPreferences; |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 76 | using WebTestRunner::WebTask; |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 77 | using WebTestRunner::WebTestInterfaces; |
[email protected] | 9063bf6 | 2013-02-20 19:42:01 | [diff] [blame] | 78 | using WebTestRunner::WebTestProxyBase; |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 79 | |
[email protected] | 31d71b0 | 2012-01-26 03:42:31 | [diff] [blame] | 80 | namespace content { |
| 81 | |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 82 | namespace { |
| 83 | |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 84 | int kDefaultLayoutTestTimeoutMs = 30 * 1000; |
| 85 | |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 86 | void InvokeTaskHelper(void* context) { |
| 87 | WebTask* task = reinterpret_cast<WebTask*>(context); |
| 88 | task->run(); |
| 89 | delete task; |
| 90 | } |
| 91 | |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 92 | #if !defined(OS_MACOSX) |
| 93 | void MakeBitmapOpaque(SkBitmap* bitmap) { |
| 94 | SkAutoLockPixels lock(*bitmap); |
| 95 | DCHECK(bitmap->config() == SkBitmap::kARGB_8888_Config); |
| 96 | for (int y = 0; y < bitmap->height(); ++y) { |
| 97 | uint32_t* row = bitmap->getAddr32(0, y); |
| 98 | for (int x = 0; x < bitmap->width(); ++x) |
| 99 | row[x] |= 0xFF000000; // Set alpha bits to 1. |
| 100 | } |
| 101 | } |
| 102 | #endif |
| 103 | |
[email protected] | b9fad24c | 2012-11-15 08:22:10 | [diff] [blame] | 104 | void CopyCanvasToBitmap(SkCanvas* canvas, SkBitmap* snapshot) { |
[email protected] | 9d611ca | 2012-11-14 13:46:56 | [diff] [blame] | 105 | SkDevice* device = skia::GetTopDevice(*canvas); |
[email protected] | 0799da0 | 2012-06-27 10:58:51 | [diff] [blame] | 106 | const SkBitmap& bitmap = device->accessBitmap(false); |
| 107 | bitmap.copyTo(snapshot, SkBitmap::kARGB_8888_Config); |
| 108 | |
| 109 | #if !defined(OS_MACOSX) |
| 110 | // Only the expected PNGs for Mac have a valid alpha channel. |
| 111 | MakeBitmapOpaque(snapshot); |
| 112 | #endif |
| 113 | |
| 114 | } |
| 115 | |
[email protected] | f322356c | 2013-03-01 07:54:02 | [diff] [blame] | 116 | class SyncNavigationStateVisitor : public RenderViewVisitor { |
| 117 | public: |
| 118 | SyncNavigationStateVisitor() {} |
| 119 | virtual ~SyncNavigationStateVisitor() {} |
| 120 | |
| 121 | virtual bool Visit(RenderView* render_view) OVERRIDE { |
| 122 | SyncNavigationState(render_view); |
| 123 | return true; |
| 124 | } |
| 125 | private: |
| 126 | DISALLOW_COPY_AND_ASSIGN(SyncNavigationStateVisitor); |
| 127 | }; |
| 128 | |
[email protected] | 95026a0 | 2013-03-05 08:34:30 | [diff] [blame] | 129 | class ProxyToRenderViewVisitor : public RenderViewVisitor { |
| 130 | public: |
| 131 | explicit ProxyToRenderViewVisitor(WebTestProxyBase* proxy) |
| 132 | : proxy_(proxy), |
| 133 | render_view_(NULL) { |
| 134 | } |
| 135 | virtual ~ProxyToRenderViewVisitor() {} |
| 136 | |
| 137 | RenderView* render_view() const { return render_view_; } |
| 138 | |
| 139 | virtual bool Visit(RenderView* render_view) OVERRIDE { |
| 140 | WebKitTestRunner* test_runner = WebKitTestRunner::Get(render_view); |
| 141 | if (!test_runner) { |
| 142 | NOTREACHED(); |
| 143 | return true; |
| 144 | } |
| 145 | if (test_runner->proxy() == proxy_) { |
| 146 | render_view_ = render_view; |
| 147 | return false; |
| 148 | } |
| 149 | return true; |
| 150 | } |
| 151 | private: |
| 152 | WebTestProxyBase* proxy_; |
| 153 | RenderView* render_view_; |
| 154 | |
| 155 | DISALLOW_COPY_AND_ASSIGN(ProxyToRenderViewVisitor); |
| 156 | }; |
| 157 | |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 158 | } // namespace |
[email protected] | cccb5cf | 2012-06-06 22:20:04 | [diff] [blame] | 159 | |
[email protected] | 9b4c6cd | 2012-08-20 10:47:45 | [diff] [blame] | 160 | WebKitTestRunner::WebKitTestRunner(RenderView* render_view) |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 161 | : RenderViewObserver(render_view), |
[email protected] | 2025a2f4 | 2013-02-18 07:25:41 | [diff] [blame] | 162 | RenderViewObserverTracker<WebKitTestRunner>(render_view), |
[email protected] | ab683b2 | 2013-03-04 09:10:31 | [diff] [blame] | 163 | proxy_(NULL), |
[email protected] | 95026a0 | 2013-03-05 08:34:30 | [diff] [blame] | 164 | focused_view_(NULL), |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 165 | enable_pixel_dumping_(true), |
| 166 | layout_test_timeout_(kDefaultLayoutTestTimeoutMs), |
| 167 | allow_external_pages_(false), |
| 168 | is_main_window_(false) { |
[email protected] | 31d71b0 | 2012-01-26 03:42:31 | [diff] [blame] | 169 | } |
| 170 | |
[email protected] | 9b4c6cd | 2012-08-20 10:47:45 | [diff] [blame] | 171 | WebKitTestRunner::~WebKitTestRunner() { |
[email protected] | 31d71b0 | 2012-01-26 03:42:31 | [diff] [blame] | 172 | } |
| 173 | |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 174 | // WebTestDelegate ----------------------------------------------------------- |
| 175 | |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 176 | void WebKitTestRunner::clearEditCommand() { |
| 177 | render_view()->ClearEditCommands(); |
| 178 | } |
| 179 | |
| 180 | void WebKitTestRunner::setEditCommand(const std::string& name, |
| 181 | const std::string& value) { |
| 182 | render_view()->SetEditCommandForNextKeyEvent(name, value); |
| 183 | } |
| 184 | |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 185 | void WebKitTestRunner::setGamepadData(const WebGamepads& gamepads) { |
[email protected] | e519692 | 2012-12-11 22:18:25 | [diff] [blame] | 186 | SetMockGamepads(gamepads); |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | void WebKitTestRunner::printMessage(const std::string& message) { |
| 190 | Send(new ShellViewHostMsg_PrintMessage(routing_id(), message)); |
| 191 | } |
| 192 | |
| 193 | void WebKitTestRunner::postTask(WebTask* task) { |
[email protected] | 2a58eb1 | 2012-12-18 07:56:40 | [diff] [blame] | 194 | Platform::current()->callOnMainThread(InvokeTaskHelper, task); |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { |
| 198 | MessageLoop::current()->PostDelayedTask( |
| 199 | FROM_HERE, |
| 200 | base::Bind(&WebTask::run, base::Owned(task)), |
| 201 | base::TimeDelta::FromMilliseconds(ms)); |
| 202 | } |
| 203 | |
| 204 | WebString WebKitTestRunner::registerIsolatedFileSystem( |
| 205 | const WebKit::WebVector<WebKit::WebString>& absolute_filenames) { |
[email protected] | d30a36f | 2013-02-07 04:16:26 | [diff] [blame] | 206 | std::vector<base::FilePath> files; |
[email protected] | 984a5f7 | 2012-12-13 21:41:50 | [diff] [blame] | 207 | for (size_t i = 0; i < absolute_filenames.size(); ++i) |
| 208 | files.push_back(webkit_base::WebStringToFilePath(absolute_filenames[i])); |
| 209 | std::string filesystem_id; |
| 210 | Send(new ShellViewHostMsg_RegisterIsolatedFileSystem( |
| 211 | routing_id(), files, &filesystem_id)); |
| 212 | return WebString::fromUTF8(filesystem_id); |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | long long WebKitTestRunner::getCurrentTimeInMillisecond() { |
| 216 | return base::TimeTicks::Now().ToInternalValue() / |
| 217 | base::Time::kMicrosecondsPerMillisecond; |
| 218 | } |
| 219 | |
| 220 | WebString WebKitTestRunner::getAbsoluteWebStringFromUTF8Path( |
| 221 | const std::string& utf8_path) { |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 222 | #if defined(OS_WIN) |
[email protected] | d30a36f | 2013-02-07 04:16:26 | [diff] [blame] | 223 | base::FilePath path(UTF8ToWide(utf8_path)); |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 224 | #else |
[email protected] | d30a36f | 2013-02-07 04:16:26 | [diff] [blame] | 225 | base::FilePath path(base::SysWideToNativeMB(base::SysUTF8ToWide(utf8_path))); |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 226 | #endif |
| 227 | if (!path.IsAbsolute()) { |
| 228 | GURL base_url = |
| 229 | net::FilePathToFileURL(current_working_directory_.Append( |
| 230 | FILE_PATH_LITERAL("foo"))); |
| 231 | net::FileURLToFilePath(base_url.Resolve(utf8_path), &path); |
| 232 | } |
[email protected] | 984a5f7 | 2012-12-13 21:41:50 | [diff] [blame] | 233 | return webkit_base::FilePathToWebString(path); |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 234 | } |
| 235 | |
[email protected] | 09ec9f9 | 2012-12-17 09:46:36 | [diff] [blame] | 236 | WebURL WebKitTestRunner::localFileToDataURL(const WebURL& file_url) { |
[email protected] | d30a36f | 2013-02-07 04:16:26 | [diff] [blame] | 237 | base::FilePath local_path; |
[email protected] | 09ec9f9 | 2012-12-17 09:46:36 | [diff] [blame] | 238 | if (!net::FileURLToFilePath(file_url, &local_path)) |
| 239 | return WebURL(); |
| 240 | |
| 241 | std::string contents; |
| 242 | Send(new ShellViewHostMsg_ReadFileToString( |
| 243 | routing_id(), local_path, &contents)); |
| 244 | |
| 245 | std::string contents_base64; |
| 246 | if (!base::Base64Encode(contents, &contents_base64)) |
| 247 | return WebURL(); |
| 248 | |
| 249 | const char data_url_prefix[] = "data:text/css:charset=utf-8;base64,"; |
| 250 | return WebURL(GURL(data_url_prefix + contents_base64)); |
| 251 | } |
| 252 | |
| 253 | WebURL WebKitTestRunner::rewriteLayoutTestsURL(const std::string& utf8_url) { |
| 254 | const char kPrefix[] = "file:///tmp/LayoutTests/"; |
| 255 | const int kPrefixLen = arraysize(kPrefix) - 1; |
| 256 | |
| 257 | if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) |
| 258 | return WebURL(GURL(utf8_url)); |
| 259 | |
[email protected] | d30a36f | 2013-02-07 04:16:26 | [diff] [blame] | 260 | base::FilePath replace_path = |
[email protected] | 09ec9f9 | 2012-12-17 09:46:36 | [diff] [blame] | 261 | ShellRenderProcessObserver::GetInstance()->webkit_source_dir().Append( |
| 262 | FILE_PATH_LITERAL("LayoutTests/")); |
| 263 | #if defined(OS_WIN) |
| 264 | std::string utf8_path = WideToUTF8(replace_path.value()); |
| 265 | #else |
| 266 | std::string utf8_path = |
| 267 | WideToUTF8(base::SysNativeMBToWide(replace_path.value())); |
| 268 | #endif |
| 269 | std::string new_url = |
| 270 | std::string("file://") + utf8_path + utf8_url.substr(kPrefixLen); |
| 271 | return WebURL(GURL(new_url)); |
| 272 | } |
| 273 | |
[email protected] | b3dbcb5e | 2012-12-17 00:16:37 | [diff] [blame] | 274 | WebPreferences* WebKitTestRunner::preferences() { |
| 275 | return &prefs_; |
| 276 | } |
| 277 | |
| 278 | void WebKitTestRunner::applyPreferences() { |
| 279 | webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences(); |
[email protected] | d48eab08 | 2012-12-19 09:25:47 | [diff] [blame] | 280 | ExportLayoutTestSpecificPreferences(prefs_, &prefs); |
[email protected] | b3dbcb5e | 2012-12-17 00:16:37 | [diff] [blame] | 281 | render_view()->SetWebkitPreferences(prefs); |
[email protected] | 55915a7 | 2012-12-18 11:55:25 | [diff] [blame] | 282 | Send(new ShellViewHostMsg_OverridePreferences(routing_id(), prefs)); |
[email protected] | b3dbcb5e | 2012-12-17 00:16:37 | [diff] [blame] | 283 | } |
| 284 | |
[email protected] | 9d9ec98 | 2013-01-10 18:53:39 | [diff] [blame] | 285 | std::string WebKitTestRunner::makeURLErrorDescription( |
| 286 | const WebURLError& error) { |
| 287 | std::string domain = error.domain.utf8(); |
| 288 | int code = error.reason; |
| 289 | |
| 290 | if (domain == net::kErrorDomain) { |
| 291 | domain = "NSURLErrorDomain"; |
| 292 | switch (error.reason) { |
| 293 | case net::ERR_ABORTED: |
| 294 | code = -999; // NSURLErrorCancelled |
| 295 | break; |
| 296 | case net::ERR_UNSAFE_PORT: |
| 297 | // Our unsafe port checking happens at the network stack level, but we |
| 298 | // make this translation here to match the behavior of stock WebKit. |
| 299 | domain = "WebKitErrorDomain"; |
| 300 | code = 103; |
| 301 | break; |
| 302 | case net::ERR_ADDRESS_INVALID: |
| 303 | case net::ERR_ADDRESS_UNREACHABLE: |
| 304 | case net::ERR_NETWORK_ACCESS_DENIED: |
| 305 | code = -1004; // NSURLErrorCannotConnectToHost |
| 306 | break; |
| 307 | } |
| 308 | } else { |
| 309 | DLOG(WARNING) << "Unknown error domain"; |
| 310 | } |
| 311 | |
| 312 | return base::StringPrintf("<NSError domain %s, code %d, failing URL \"%s\">", |
| 313 | domain.c_str(), code, error.unreachableURL.spec().data()); |
| 314 | } |
| 315 | |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 316 | void WebKitTestRunner::setClientWindowRect(const WebRect& rect) { |
[email protected] | 8be1c58 | 2013-03-06 00:55:03 | [diff] [blame] | 317 | ForceResizeRenderView(render_view(), WebSize(rect.width, rect.height)); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | void WebKitTestRunner::showDevTools() { |
[email protected] | f85c584 | 2013-02-15 14:15:06 | [diff] [blame] | 321 | Send(new ShellViewHostMsg_ShowDevTools(routing_id())); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | void WebKitTestRunner::closeDevTools() { |
[email protected] | f85c584 | 2013-02-15 14:15:06 | [diff] [blame] | 325 | Send(new ShellViewHostMsg_CloseDevTools(routing_id())); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 326 | } |
| 327 | |
| 328 | void WebKitTestRunner::evaluateInWebInspector(long call_id, |
| 329 | const std::string& script) { |
[email protected] | f85c584 | 2013-02-15 14:15:06 | [diff] [blame] | 330 | WebDevToolsAgent* agent = render_view()->GetWebView()->devToolsAgent(); |
| 331 | if (agent) |
| 332 | agent->evaluateInWebInspector(call_id, WebString::fromUTF8(script)); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | void WebKitTestRunner::clearAllDatabases() { |
[email protected] | 833b700d | 2013-02-18 19:43:00 | [diff] [blame] | 336 | Send(new ShellViewHostMsg_ClearAllDatabases(routing_id())); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | void WebKitTestRunner::setDatabaseQuota(int quota) { |
[email protected] | 833b700d | 2013-02-18 19:43:00 | [diff] [blame] | 340 | Send(new ShellViewHostMsg_SetDatabaseQuota(routing_id(), quota)); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | void WebKitTestRunner::setDeviceScaleFactor(float factor) { |
[email protected] | db6769c | 2013-02-24 14:59:14 | [diff] [blame] | 344 | render_view()->GetWebView()->setDeviceScaleFactor(factor); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 345 | } |
| 346 | |
[email protected] | 83654ec | 2013-03-04 15:58:53 | [diff] [blame] | 347 | void WebKitTestRunner::setFocus(WebTestProxyBase* proxy, bool focus) { |
[email protected] | 95026a0 | 2013-03-05 08:34:30 | [diff] [blame] | 348 | ProxyToRenderViewVisitor visitor(proxy); |
| 349 | RenderView::ForEach(&visitor); |
| 350 | if (!visitor.render_view()) { |
| 351 | NOTREACHED(); |
| 352 | return; |
| 353 | } |
| 354 | |
| 355 | // Check whether the focused view was closed meanwhile. |
| 356 | if (!WebKitTestRunner::Get(focused_view_)) |
| 357 | focused_view_ = NULL; |
| 358 | |
| 359 | if (focus) { |
| 360 | if (focused_view_ != visitor.render_view()) { |
| 361 | if (focused_view_) |
| 362 | SetFocusAndActivate(focused_view_, false); |
| 363 | SetFocusAndActivate(visitor.render_view(), true); |
| 364 | focused_view_ = visitor.render_view(); |
| 365 | } |
| 366 | } else { |
| 367 | if (focused_view_ == visitor.render_view()) { |
| 368 | SetFocusAndActivate(visitor.render_view(), false); |
| 369 | focused_view_ = NULL; |
| 370 | } |
| 371 | } |
[email protected] | 83654ec | 2013-03-04 15:58:53 | [diff] [blame] | 372 | } |
| 373 | |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 374 | void WebKitTestRunner::setFocus(bool focus) { |
[email protected] | 83654ec | 2013-03-04 15:58:53 | [diff] [blame] | 375 | // TODO(jochen): Remove once the new WebKit API is rolled. |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | void WebKitTestRunner::setAcceptAllCookies(bool accept) { |
[email protected] | 833b700d | 2013-02-18 19:43:00 | [diff] [blame] | 379 | Send(new ShellViewHostMsg_AcceptAllCookies(routing_id(), accept)); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | std::string WebKitTestRunner::pathToLocalResource(const std::string& resource) { |
[email protected] | 0c5f222 | 2013-02-20 11:26:19 | [diff] [blame] | 383 | #if defined(OS_WIN) |
| 384 | if (resource.find("/tmp/") == 0) { |
| 385 | // We want a temp file. |
| 386 | GURL base_url = net::FilePathToFileURL(temp_path_); |
| 387 | return base_url.Resolve(resource.substr(strlen("/tmp/"))).spec(); |
| 388 | } |
| 389 | #endif |
| 390 | |
| 391 | // Some layout tests use file://// which we resolve as a UNC path. Normalize |
| 392 | // them to just file:///. |
| 393 | std::string result = resource; |
| 394 | while (StringToLowerASCII(result).find("file:////") == 0) { |
| 395 | result = result.substr(0, strlen("file:///")) + |
| 396 | result.substr(strlen("file:////")); |
| 397 | } |
| 398 | return rewriteLayoutTestsURL(result).spec(); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | void WebKitTestRunner::setLocale(const std::string& locale) { |
[email protected] | 833b700d | 2013-02-18 19:43:00 | [diff] [blame] | 402 | setlocale(LC_ALL, locale.c_str()); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 403 | } |
| 404 | |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 405 | void WebKitTestRunner::testFinished() { |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 406 | if (!is_main_window_) |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 407 | return; |
| 408 | WebTestInterfaces* interfaces = |
| 409 | ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 410 | interfaces->setTestIsRunning(false); |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 411 | if (interfaces->testRunner()->shouldDumpBackForwardList()) { |
[email protected] | f322356c | 2013-03-01 07:54:02 | [diff] [blame] | 412 | SyncNavigationStateVisitor visitor; |
| 413 | RenderView::ForEach(&visitor); |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 414 | Send(new ShellViewHostMsg_CaptureSessionHistory(routing_id())); |
| 415 | } else { |
| 416 | CaptureDump(); |
| 417 | } |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | void WebKitTestRunner::testTimedOut() { |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 421 | if (!is_main_window_) |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 422 | return; |
| 423 | WebTestInterfaces* interfaces = |
| 424 | ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 425 | interfaces->setTestIsRunning(false); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 426 | Send(new ShellViewHostMsg_TestFinished(routing_id(), true)); |
| 427 | } |
| 428 | |
| 429 | bool WebKitTestRunner::isBeingDebugged() { |
| 430 | return base::debug::BeingDebugged(); |
| 431 | } |
| 432 | |
| 433 | int WebKitTestRunner::layoutTestTimeout() { |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 434 | return layout_test_timeout_; |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | void WebKitTestRunner::closeRemainingWindows() { |
[email protected] | b778e18 | 2013-03-04 13:32:16 | [diff] [blame] | 438 | Send(new ShellViewHostMsg_CloseRemainingWindows(routing_id())); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | int WebKitTestRunner::navigationEntryCount() { |
[email protected] | b283d29 | 2013-02-21 08:40:34 | [diff] [blame] | 442 | return GetLocalSessionHistoryLength(render_view()); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 443 | } |
| 444 | |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 445 | void WebKitTestRunner::goToOffset(int offset) { |
[email protected] | d2494ff | 2013-02-20 08:22:37 | [diff] [blame] | 446 | Send(new ShellViewHostMsg_GoToOffset(routing_id(), offset)); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 447 | } |
| 448 | |
| 449 | void WebKitTestRunner::reload() { |
[email protected] | d2494ff | 2013-02-20 08:22:37 | [diff] [blame] | 450 | Send(new ShellViewHostMsg_Reload(routing_id())); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 451 | } |
| 452 | |
| 453 | void WebKitTestRunner::loadURLForFrame(const WebURL& url, |
| 454 | const std::string& frame_name) { |
[email protected] | d2494ff | 2013-02-20 08:22:37 | [diff] [blame] | 455 | Send(new ShellViewHostMsg_LoadURLForFrame( |
| 456 | routing_id(), url, frame_name)); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 457 | } |
| 458 | |
| 459 | bool WebKitTestRunner::allowExternalPages() { |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 460 | return allow_external_pages_; |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 461 | } |
| 462 | |
| 463 | void WebKitTestRunner::captureHistoryForWindow( |
[email protected] | 9063bf6 | 2013-02-20 19:42:01 | [diff] [blame] | 464 | WebTestProxyBase* proxy, |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 465 | WebVector<WebKit::WebHistoryItem>* history, |
| 466 | size_t* currentEntryIndex) { |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 467 | size_t pos = 0; |
| 468 | std::vector<int>::iterator id; |
| 469 | for (id = routing_ids_.begin(); id != routing_ids_.end(); ++id, ++pos) { |
| 470 | RenderView* render_view = RenderView::FromRoutingID(*id); |
| 471 | if (!render_view) { |
| 472 | NOTREACHED(); |
| 473 | continue; |
| 474 | } |
| 475 | if (WebKitTestRunner::Get(render_view)->proxy() == proxy) |
| 476 | break; |
| 477 | } |
| 478 | |
| 479 | if (id == routing_ids_.end()) { |
| 480 | NOTREACHED(); |
| 481 | return; |
| 482 | } |
| 483 | size_t num_entries = session_histories_[pos].size(); |
| 484 | *currentEntryIndex = current_entry_indexes_[pos]; |
| 485 | WebVector<WebHistoryItem> result(num_entries); |
| 486 | for (size_t entry = 0; entry < num_entries; ++entry) { |
| 487 | result[entry] = |
| 488 | webkit_glue::HistoryItemFromString(session_histories_[pos][entry]); |
| 489 | } |
| 490 | history->swap(result); |
[email protected] | 29e8270 | 2013-02-14 12:56:40 | [diff] [blame] | 491 | } |
| 492 | |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 493 | // RenderViewObserver -------------------------------------------------------- |
| 494 | |
[email protected] | 9b4c6cd | 2012-08-20 10:47:45 | [diff] [blame] | 495 | void WebKitTestRunner::DidClearWindowObject(WebFrame* frame) { |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 496 | ShellRenderProcessObserver::GetInstance()->BindTestRunnersToWindow(frame); |
[email protected] | 96b80b47 | 2012-07-03 19:41:56 | [diff] [blame] | 497 | } |
| 498 | |
[email protected] | 9b4c6cd | 2012-08-20 10:47:45 | [diff] [blame] | 499 | bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 500 | bool handled = true; |
[email protected] | 9b4c6cd | 2012-08-20 10:47:45 | [diff] [blame] | 501 | IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 502 | IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, |
| 503 | OnSetTestConfiguration) |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 504 | IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) |
[email protected] | efb5f57 | 2012-01-29 10:57:33 | [diff] [blame] | 505 | IPC_MESSAGE_UNHANDLED(handled = false) |
| 506 | IPC_END_MESSAGE_MAP() |
| 507 | |
| 508 | return handled; |
| 509 | } |
| 510 | |
[email protected] | b9fad24c | 2012-11-15 08:22:10 | [diff] [blame] | 511 | // Public methods - ----------------------------------------------------------- |
| 512 | |
[email protected] | 324825d | 2012-11-30 12:37:15 | [diff] [blame] | 513 | void WebKitTestRunner::Reset() { |
[email protected] | ab683b2 | 2013-03-04 09:10:31 | [diff] [blame] | 514 | // The proxy_ is always non-NULL, it is set right after construction. |
| 515 | proxy_->reset(); |
[email protected] | b3dbcb5e | 2012-12-17 00:16:37 | [diff] [blame] | 516 | prefs_.reset(); |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 517 | enable_pixel_dumping_ = true; |
| 518 | layout_test_timeout_ = kDefaultLayoutTestTimeoutMs; |
| 519 | allow_external_pages_ = false; |
| 520 | expected_pixel_hash_ = std::string(); |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 521 | routing_ids_.clear(); |
| 522 | session_histories_.clear(); |
| 523 | current_entry_indexes_.clear(); |
[email protected] | 324825d | 2012-11-30 12:37:15 | [diff] [blame] | 524 | } |
| 525 | |
[email protected] | b2324b09 | 2012-11-01 10:34:11 | [diff] [blame] | 526 | // Private methods ----------------------------------------------------------- |
| 527 | |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 528 | void WebKitTestRunner::CaptureDump() { |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 529 | WebTestInterfaces* interfaces = |
| 530 | ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 531 | |
[email protected] | 893fc636 | 2013-02-18 13:24:05 | [diff] [blame] | 532 | if (interfaces->testRunner()->shouldDumpAsAudio()) { |
| 533 | const WebArrayBufferView* audio_data = |
| 534 | interfaces->testRunner()->audioData(); |
| 535 | std::vector<unsigned char> vector_data( |
| 536 | static_cast<const unsigned char*>(audio_data->baseAddress()), |
| 537 | static_cast<const unsigned char*>(audio_data->baseAddress()) + |
| 538 | audio_data->byteLength()); |
| 539 | Send(new ShellViewHostMsg_AudioDump(routing_id(), vector_data)); |
| 540 | Send(new ShellViewHostMsg_TestFinished(routing_id(), false)); |
| 541 | return; |
| 542 | } |
| 543 | |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 544 | Send( |
| 545 | new ShellViewHostMsg_TextDump(routing_id(), proxy()->captureTree(false))); |
| 546 | |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 547 | if (enable_pixel_dumping_ && |
[email protected] | 1600076 | 2013-03-04 12:43:38 | [diff] [blame] | 548 | interfaces->testRunner()->shouldGeneratePixelResults()) { |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 549 | SkBitmap snapshot; |
| 550 | CopyCanvasToBitmap(proxy()->capturePixels(), &snapshot); |
| 551 | |
| 552 | SkAutoLockPixels snapshot_lock(snapshot); |
| 553 | base::MD5Digest digest; |
| 554 | #if defined(OS_ANDROID) |
| 555 | // On Android, pixel layout is RGBA, however, other Chrome platforms use |
| 556 | // BGRA. |
| 557 | const uint8_t* raw_pixels = |
| 558 | reinterpret_cast<const uint8_t*>(snapshot.getPixels()); |
| 559 | size_t snapshot_size = snapshot.getSize(); |
| 560 | scoped_array<uint8_t> reordered_pixels(new uint8_t[snapshot_size]); |
| 561 | for (size_t i = 0; i < snapshot_size; i += 4) { |
| 562 | reordered_pixels[i] = raw_pixels[i + 2]; |
| 563 | reordered_pixels[i + 1] = raw_pixels[i + 1]; |
| 564 | reordered_pixels[i + 2] = raw_pixels[i]; |
| 565 | reordered_pixels[i + 3] = raw_pixels[i + 3]; |
| 566 | } |
| 567 | base::MD5Sum(reordered_pixels.get(), snapshot_size, &digest); |
| 568 | #else |
| 569 | base::MD5Sum(snapshot.getPixels(), snapshot.getSize(), &digest); |
| 570 | #endif |
| 571 | std::string actual_pixel_hash = base::MD5DigestToBase16(digest); |
| 572 | |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 573 | if (actual_pixel_hash == expected_pixel_hash_) { |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 574 | SkBitmap empty_image; |
| 575 | Send(new ShellViewHostMsg_ImageDump( |
| 576 | routing_id(), actual_pixel_hash, empty_image)); |
| 577 | } else { |
| 578 | Send(new ShellViewHostMsg_ImageDump( |
| 579 | routing_id(), actual_pixel_hash, snapshot)); |
| 580 | } |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 581 | } |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 582 | |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 583 | Send(new ShellViewHostMsg_TestFinished(routing_id(), false)); |
| 584 | } |
| 585 | |
[email protected] | 0ac1a03 | 2013-02-12 12:53:37 | [diff] [blame] | 586 | void WebKitTestRunner::OnSetTestConfiguration( |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 587 | const ShellViewMsg_SetTestConfiguration_Params& params) { |
| 588 | current_working_directory_ = params.current_working_directory; |
| 589 | temp_path_ = params.temp_path; |
| 590 | enable_pixel_dumping_ = params.enable_pixel_dumping; |
| 591 | layout_test_timeout_ = params.layout_test_timeout; |
| 592 | allow_external_pages_ = params.allow_external_pages; |
| 593 | expected_pixel_hash_ = params.expected_pixel_hash; |
[email protected] | 5f20df36 | 2013-02-15 19:48:19 | [diff] [blame] | 594 | is_main_window_ = true; |
[email protected] | d679c86 | 2013-03-07 10:31:41 | [diff] [blame^] | 595 | |
| 596 | setFocus(proxy_, true); |
| 597 | |
| 598 | WebTestInterfaces* interfaces = |
| 599 | ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
| 600 | interfaces->setTestIsRunning(true); |
| 601 | interfaces->configureForTestWithURL(params.test_url, enable_pixel_dumping_); |
[email protected] | 0d2dfb92d | 2012-11-05 10:26:45 | [diff] [blame] | 602 | } |
| 603 | |
[email protected] | 8f72269 | 2013-02-23 14:14:06 | [diff] [blame] | 604 | void WebKitTestRunner::OnSessionHistory( |
| 605 | const std::vector<int>& routing_ids, |
| 606 | const std::vector<std::vector<std::string> >& session_histories, |
| 607 | const std::vector<unsigned>& current_entry_indexes) { |
| 608 | routing_ids_ = routing_ids; |
| 609 | session_histories_ = session_histories; |
| 610 | current_entry_indexes_ = current_entry_indexes; |
| 611 | CaptureDump(); |
| 612 | } |
| 613 | |
[email protected] | 31d71b0 | 2012-01-26 03:42:31 | [diff] [blame] | 614 | } // namespace content |