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 "content/shell/webkit_test_runner.h" | 5 #include "content/shell/webkit_test_runner.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <clocale> | 8 #include <clocale> |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 51 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
52 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web Task.h" | 52 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web Task.h" |
53 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestInterfaces.h" | 53 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestInterfaces.h" |
54 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestProxy.h" | 54 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestProxy.h" |
55 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestRunner.h" | 55 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestRunner.h" |
56 #include "ui/gfx/rect.h" | 56 #include "ui/gfx/rect.h" |
57 #include "webkit/base/file_path_string_conversions.h" | 57 #include "webkit/base/file_path_string_conversions.h" |
58 #include "webkit/glue/glue_serialize.h" | 58 #include "webkit/glue/glue_serialize.h" |
59 #include "webkit/glue/webkit_glue.h" | 59 #include "webkit/glue/webkit_glue.h" |
60 #include "webkit/glue/webpreferences.h" | 60 #include "webkit/glue/webpreferences.h" |
61 #include "webkit/mocks/test_media_stream_client.h" | |
61 | 62 |
62 using WebKit::Platform; | 63 using WebKit::Platform; |
63 using WebKit::WebArrayBufferView; | 64 using WebKit::WebArrayBufferView; |
64 using WebKit::WebContextMenuData; | 65 using WebKit::WebContextMenuData; |
65 using WebKit::WebDevToolsAgent; | 66 using WebKit::WebDevToolsAgent; |
66 using WebKit::WebDeviceOrientation; | 67 using WebKit::WebDeviceOrientation; |
67 using WebKit::WebElement; | 68 using WebKit::WebElement; |
68 using WebKit::WebFrame; | 69 using WebKit::WebFrame; |
69 using WebKit::WebGamepads; | 70 using WebKit::WebGamepads; |
70 using WebKit::WebHistoryItem; | 71 using WebKit::WebHistoryItem; |
72 using WebKit::WebMediaPlayer; | |
73 using WebKit::WebMediaPlayerClient; | |
71 using WebKit::WebPoint; | 74 using WebKit::WebPoint; |
72 using WebKit::WebRect; | 75 using WebKit::WebRect; |
73 using WebKit::WebSize; | 76 using WebKit::WebSize; |
74 using WebKit::WebString; | 77 using WebKit::WebString; |
75 using WebKit::WebURL; | 78 using WebKit::WebURL; |
76 using WebKit::WebURLError; | 79 using WebKit::WebURLError; |
77 using WebKit::WebURLRequest; | 80 using WebKit::WebURLRequest; |
78 using WebKit::WebTestingSupport; | 81 using WebKit::WebTestingSupport; |
79 using WebKit::WebVector; | 82 using WebKit::WebVector; |
80 using WebKit::WebView; | 83 using WebKit::WebView; |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 size_t num_entries = session_histories_[pos].size(); | 485 size_t num_entries = session_histories_[pos].size(); |
483 *currentEntryIndex = current_entry_indexes_[pos]; | 486 *currentEntryIndex = current_entry_indexes_[pos]; |
484 WebVector<WebHistoryItem> result(num_entries); | 487 WebVector<WebHistoryItem> result(num_entries); |
485 for (size_t entry = 0; entry < num_entries; ++entry) { | 488 for (size_t entry = 0; entry < num_entries; ++entry) { |
486 result[entry] = | 489 result[entry] = |
487 webkit_glue::HistoryItemFromString(session_histories_[pos][entry]); | 490 webkit_glue::HistoryItemFromString(session_histories_[pos][entry]); |
488 } | 491 } |
489 history->swap(result); | 492 history->swap(result); |
490 } | 493 } |
491 | 494 |
495 WebMediaPlayer* WebKitTestRunner::createWebMediaPlayer( | |
496 WebFrame* frame, const WebURL& url, WebMediaPlayerClient* client) | |
497 { | |
498 if (!test_media_stream_client_.get()) | |
jochen (gone - plz use gerrit)
2013/04/03 07:18:58
nit. { } required for multi-line if body
wjia(left Chromium)
2013/04/04 14:21:51
Done.
| |
499 test_media_stream_client_.reset( | |
500 new webkit_glue::TestMediaStreamClient()); | |
501 return webkit_glue::CreateMediaPlayer( | |
502 frame, url, client, test_media_stream_client_.get()); | |
503 } | |
504 | |
492 // RenderViewObserver -------------------------------------------------------- | 505 // RenderViewObserver -------------------------------------------------------- |
493 | 506 |
494 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame) { | 507 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame) { |
495 WebTestingSupport::injectInternalsObject(frame); | 508 WebTestingSupport::injectInternalsObject(frame); |
496 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); | 509 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); |
497 } | 510 } |
498 | 511 |
499 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { | 512 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { |
500 bool handled = true; | 513 bool handled = true; |
501 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) | 514 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
641 ShellRenderProcessObserver::GetInstance()->test_interfaces()->resetAll(); | 654 ShellRenderProcessObserver::GetInstance()->test_interfaces()->resetAll(); |
642 Reset(); | 655 Reset(); |
643 // Navigating to about:blank will make sure that no new loads are initiated | 656 // Navigating to about:blank will make sure that no new loads are initiated |
644 // by the renderer. | 657 // by the renderer. |
645 render_view()->GetWebView()->mainFrame() | 658 render_view()->GetWebView()->mainFrame() |
646 ->loadRequest(WebURLRequest(GURL("about:blank"))); | 659 ->loadRequest(WebURLRequest(GURL("about:blank"))); |
647 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 660 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
648 } | 661 } |
649 | 662 |
650 } // namespace content | 663 } // namespace content |
OLD | NEW |