Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: content/shell/webkit_test_runner.cc

Issue 13159005: Enable media stream layout test with content_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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/support/test_media_stream_client.h"
62 #include "webkit/support/webkit_support.h"
jochen (gone - plz use gerrit) 2013/04/02 07:02:21 content/ must not depend on webkit/support. You c
wjia(left Chromium) 2013/04/03 00:44:04 Done.
61 63
62 using WebKit::Platform; 64 using WebKit::Platform;
63 using WebKit::WebArrayBufferView; 65 using WebKit::WebArrayBufferView;
64 using WebKit::WebContextMenuData; 66 using WebKit::WebContextMenuData;
65 using WebKit::WebDevToolsAgent; 67 using WebKit::WebDevToolsAgent;
66 using WebKit::WebDeviceOrientation; 68 using WebKit::WebDeviceOrientation;
67 using WebKit::WebElement; 69 using WebKit::WebElement;
68 using WebKit::WebFrame; 70 using WebKit::WebFrame;
69 using WebKit::WebGamepads; 71 using WebKit::WebGamepads;
70 using WebKit::WebHistoryItem; 72 using WebKit::WebHistoryItem;
73 using WebKit::WebMediaPlayer;
74 using WebKit::WebMediaPlayerClient;
71 using WebKit::WebPoint; 75 using WebKit::WebPoint;
72 using WebKit::WebRect; 76 using WebKit::WebRect;
73 using WebKit::WebSize; 77 using WebKit::WebSize;
74 using WebKit::WebString; 78 using WebKit::WebString;
75 using WebKit::WebURL; 79 using WebKit::WebURL;
76 using WebKit::WebURLError; 80 using WebKit::WebURLError;
77 using WebKit::WebURLRequest; 81 using WebKit::WebURLRequest;
78 using WebKit::WebTestingSupport; 82 using WebKit::WebTestingSupport;
79 using WebKit::WebVector; 83 using WebKit::WebVector;
80 using WebKit::WebView; 84 using WebKit::WebView;
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 size_t num_entries = session_histories_[pos].size(); 486 size_t num_entries = session_histories_[pos].size();
483 *currentEntryIndex = current_entry_indexes_[pos]; 487 *currentEntryIndex = current_entry_indexes_[pos];
484 WebVector<WebHistoryItem> result(num_entries); 488 WebVector<WebHistoryItem> result(num_entries);
485 for (size_t entry = 0; entry < num_entries; ++entry) { 489 for (size_t entry = 0; entry < num_entries; ++entry) {
486 result[entry] = 490 result[entry] =
487 webkit_glue::HistoryItemFromString(session_histories_[pos][entry]); 491 webkit_glue::HistoryItemFromString(session_histories_[pos][entry]);
488 } 492 }
489 history->swap(result); 493 history->swap(result);
490 } 494 }
491 495
496 WebMediaPlayer* WebKitTestRunner::createWebMediaPlayer(
497 WebFrame* frame, const WebURL& url, WebMediaPlayerClient* client)
498 {
499 #if ENABLE_WEBRTC
500 if (!test_media_stream_client_.get())
501 test_media_stream_client_.reset(
502 new webkit_support::TestMediaStreamClient());
503 return webkit_support::CreateMediaPlayer(frame, url, client,
504 test_media_stream_client_.get());
505 #else
506 return webkit_support::CreateMediaPlayer(frame, url, client);
507 #endif // ENABLE_WEBRTC
508 }
509
492 // RenderViewObserver -------------------------------------------------------- 510 // RenderViewObserver --------------------------------------------------------
493 511
494 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame) { 512 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame) {
495 WebTestingSupport::injectInternalsObject(frame); 513 WebTestingSupport::injectInternalsObject(frame);
496 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); 514 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame);
497 } 515 }
498 516
499 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { 517 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) {
500 bool handled = true; 518 bool handled = true;
501 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) 519 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message)
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 ShellRenderProcessObserver::GetInstance()->test_interfaces()->resetAll(); 659 ShellRenderProcessObserver::GetInstance()->test_interfaces()->resetAll();
642 Reset(); 660 Reset();
643 // Navigating to about:blank will make sure that no new loads are initiated 661 // Navigating to about:blank will make sure that no new loads are initiated
644 // by the renderer. 662 // by the renderer.
645 render_view()->GetWebView()->mainFrame() 663 render_view()->GetWebView()->mainFrame()
646 ->loadRequest(WebURLRequest(GURL("about:blank"))); 664 ->loadRequest(WebURLRequest(GURL("about:blank")));
647 Send(new ShellViewHostMsg_ResetDone(routing_id())); 665 Send(new ShellViewHostMsg_ResetDone(routing_id()));
648 } 666 }
649 667
650 } // namespace content 668 } // namespace content
OLDNEW
« content/shell/webkit_test_runner.h ('K') | « content/shell/webkit_test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698