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

Side by Side Diff: third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html

Issue 2706453002: [Presentation API] return valid WebPresentationConnection object in PresentationReceiver (Closed)
Patch Set: add layout test for receiver.connectionList Created 3 years, 10 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script src="../resources/mojo-helpers.js"></script>
7 <script src="resources/presentation-service-mock.js"></script>
8 <script>
9
10 async_test(t => {
11 internals.settings.setPresentationReceiver(true);
12 t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); });
13
14 presentationServiceMock.then(mockService => {
15 // Invoke mockService.setClient().
16 var receiver = navigator.presentation.receiver;
mark a. foltz 2017/02/21 17:47:38 s/var/const/
zhaobin 2017/02/21 19:11:38 Done.
17
18 // Make sure it is invoked after calling setClient().
19 setTimeout(() => {
mark a. foltz 2017/02/21 17:47:38 Does the rest of the test need to be in an event h
zhaobin 2017/02/21 19:11:38 Yes, put them in an event handler to make sure thi
20 const url = 'http://example.com/a.html';
21 const id = 'fakeSessionId';
22 mockService.onReceiverConnectionAvailable(url, id);
23
24 receiver.connectionList.then(
25 t.step_func_done(list => {
26 assert_equals(list.connections.length, 1);
27 list.connections.map(connection => {
mark a. foltz 2017/02/21 17:47:38 Since the length is 1, you could just write asser
zhaobin 2017/02/21 19:11:38 Done.
28 assert_equals(connection.url, url);
29 assert_equals(connection.id, id);
30 });
31 }));
32 });
33 });
34 }, "Test presetnation.receiver.connectionList resolves with incoming connection. ");
35
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698