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

Side by Side Diff: ppapi/tests/test_video_source.cc

Issue 121203002: Use window.URL instead of window.webkitURL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: window.URL -> URL in user_images_grid.js Created 6 years, 11 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
« no previous file with comments | « ppapi/tests/test_video_destination.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 // Tests PPB_VideoSource_Private interface. 5 // Tests PPB_VideoSource_Private interface.
6 6
7 #include "ppapi/tests/test_video_source.h" 7 #include "ppapi/tests/test_video_source.h"
8 8
9 #include <string.h> 9 #include <string.h>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ppb_video_source_private_interface_->IsVideoSource(video_source)); 87 ppb_video_source_private_interface_->IsVideoSource(video_source));
88 88
89 PASS(); 89 PASS();
90 } 90 }
91 91
92 std::string TestVideoSource::TestGetFrame() { 92 std::string TestVideoSource::TestGetFrame() {
93 std::string js_code; 93 std::string js_code;
94 js_code += "var test_stream;" 94 js_code += "var test_stream;"
95 "function gotStream(stream){" 95 "function gotStream(stream){"
96 " test_stream = stream;" 96 " test_stream = stream;"
97 " var url = webkitURL.createObjectURL(test_stream);" 97 " var url = URL.createObjectURL(test_stream);"
98 " var plugin = document.getElementById('plugin');" 98 " var plugin = document.getElementById('plugin');"
99 " plugin.postMessage(url);" 99 " plugin.postMessage(url);"
100 "}" 100 "}"
101 "navigator.webkitGetUserMedia(" 101 "navigator.webkitGetUserMedia("
102 "{audio:false, video:true}, gotStream, function() {});"; 102 "{audio:false, video:true}, gotStream, function() {});";
103 instance_->EvalScript(js_code); 103 instance_->EvalScript(js_code);
104 event_.Wait(); 104 event_.Wait();
105 105
106 pp::VideoSource_Private video_source(instance_); 106 pp::VideoSource_Private video_source(instance_);
107 TestCompletionCallback cc1(instance_->pp_instance(), false); 107 TestCompletionCallback cc1(instance_->pp_instance(), false);
108 cc1.WaitForResult(video_source.Open(stream_url_, cc1.GetCallback())); 108 cc1.WaitForResult(video_source.Open(stream_url_, cc1.GetCallback()));
109 ASSERT_EQ(PP_OK, cc1.result()); 109 ASSERT_EQ(PP_OK, cc1.result());
110 TestCompletionCallbackWithOutput<pp::VideoFrame_Private> cc2( 110 TestCompletionCallbackWithOutput<pp::VideoFrame_Private> cc2(
111 instance_->pp_instance(), false); 111 instance_->pp_instance(), false);
112 cc2.WaitForResult(video_source.GetFrame(cc2.GetCallback())); 112 cc2.WaitForResult(video_source.GetFrame(cc2.GetCallback()));
113 ASSERT_EQ(PP_OK, cc2.result()); 113 ASSERT_EQ(PP_OK, cc2.result());
114 const pp::VideoFrame_Private video_frame = cc2.output(); 114 const pp::VideoFrame_Private video_frame = cc2.output();
115 ASSERT_FALSE(video_frame.image_data().is_null()); 115 ASSERT_FALSE(video_frame.image_data().is_null());
116 116
117 video_source.Close(); 117 video_source.Close();
118 118
119 PASS(); 119 PASS();
120 } 120 }
121 121
OLDNEW
« no previous file with comments | « ppapi/tests/test_video_destination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698