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

Side by Side Diff: ios/web/test/data/mojo_test.js

Issue 2285043002: [ios] Use args destructuring in Mojo test promise. (Closed)
Patch Set: Self review Created 4 years, 3 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 | « no previous file | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // This module provides the test page for WebUIMojoTest. Once the page is 5 // This module provides the test page for WebUIMojoTest. Once the page is
6 // loaded it sends "syn" message to the native code. Once page receives "ack" 6 // loaded it sends "syn" message to the native code. Once page receives "ack"
7 // from the native code, the page then sends "fin". Test succeeds only when 7 // from the native code, the page then sends "fin". Test succeeds only when
8 // "fin" is received by the native page. Refer to 8 // "fin" is received by the native page. Refer to
9 // ios/web/webui/web_ui_mojo_inttest.mm for testing code. 9 // ios/web/webui/web_ui_mojo_inttest.mm for testing code.
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 * @return {!Promise} Fires when DOMContentLoaded event is received. 49 * @return {!Promise} Fires when DOMContentLoaded event is received.
50 */ 50 */
51 function whenDomContentLoaded() { 51 function whenDomContentLoaded() {
52 return new Promise(function(resolve, reject) { 52 return new Promise(function(resolve, reject) {
53 document.addEventListener('DOMContentLoaded', resolve); 53 document.addEventListener('DOMContentLoaded', resolve);
54 }); 54 });
55 } 55 }
56 56
57 function main() { 57 function main() {
58 Promise.all([ 58 Promise.all([
59 whenDomContentLoaded(), getBrowserProxy() 59 getBrowserProxy(), whenDomContentLoaded()
60 ]).then(function(results) { 60 ]).then(function([browserProxy]) {
61 var browserProxy = results[1];
62 // Send "syn" so native code should reply with "ack". 61 // Send "syn" so native code should reply with "ack".
63 browserProxy.handleJsMessage('syn'); 62 browserProxy.handleJsMessage('syn');
64 }); 63 });
65 } 64 }
66 main(); 65 main();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698