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 var util = {}; | 5 var util = {}; |
6 var embedder = {}; | 6 var embedder = {}; |
7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
8 embedder.emptyGuestURL = ''; | 8 embedder.emptyGuestURL = ''; |
9 embedder.windowOpenGuestURL = ''; | 9 embedder.windowOpenGuestURL = ''; |
10 embedder.noReferrerGuestURL = ''; | 10 embedder.noReferrerGuestURL = ''; |
(...skipping 29 matching lines...) Expand all Loading... | |
40 | 40 |
41 // Creates a <webview> tag in document.body and returns the reference to it. | 41 // Creates a <webview> tag in document.body and returns the reference to it. |
42 // It also sets a dummy src. The dummy src is significant because this makes | 42 // It also sets a dummy src. The dummy src is significant because this makes |
43 // sure that the <object> shim is created (asynchronously at this point) for the | 43 // sure that the <object> shim is created (asynchronously at this point) for the |
44 // <webview> tag. This makes the <webview> tag ready for add/removeEventListener | 44 // <webview> tag. This makes the <webview> tag ready for add/removeEventListener |
45 // calls. | 45 // calls. |
46 util.createWebViewTagInDOM = function(partitionName) { | 46 util.createWebViewTagInDOM = function(partitionName) { |
47 var webview = document.createElement('webview'); | 47 var webview = document.createElement('webview'); |
48 webview.style.width = '300px'; | 48 webview.style.width = '300px'; |
49 webview.style.height = '200px'; | 49 webview.style.height = '200px'; |
50 var urlDummy = 'data:text/html,<body>Initial dummy guest</body>'; | 50 var urlDummy = util.createDataUrl('<body>Initial dummy guest</body>'); |
51 webview.setAttribute('src', urlDummy); | 51 webview.setAttribute('src', urlDummy); |
52 webview.setAttribute('partition', partitionName); | 52 webview.setAttribute('partition', partitionName); |
53 document.body.appendChild(webview); | 53 document.body.appendChild(webview); |
54 return webview; | 54 return webview; |
55 }; | 55 }; |
56 | 56 |
57 // Creates a data: URL correctly escaping the html content. | |
58 util.createDataUrl = function(html) { | |
59 return 'data:text/html,' + encodeURIComponent(html); | |
60 }; | |
61 | |
57 embedder.test = {}; | 62 embedder.test = {}; |
58 embedder.test.succeed = function() { | 63 embedder.test.succeed = function() { |
59 chrome.test.sendMessage('DoneShimTest.PASSED'); | 64 chrome.test.sendMessage('DoneShimTest.PASSED'); |
60 }; | 65 }; |
61 | 66 |
62 embedder.test.fail = function() { | 67 embedder.test.fail = function() { |
63 chrome.test.sendMessage('DoneShimTest.FAILED'); | 68 chrome.test.sendMessage('DoneShimTest.FAILED'); |
64 }; | 69 }; |
65 | 70 |
66 embedder.test.assertEq = function(a, b) { | 71 embedder.test.assertEq = function(a, b) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 webview.setAttribute('maxheight', 110); | 103 webview.setAttribute('maxheight', 110); |
99 | 104 |
100 webview.addEventListener('sizechanged', function(e) { | 105 webview.addEventListener('sizechanged', function(e) { |
101 embedder.test.assertEq(0, e.oldWidth); | 106 embedder.test.assertEq(0, e.oldWidth); |
102 embedder.test.assertEq(0, e.oldHeight); | 107 embedder.test.assertEq(0, e.oldHeight); |
103 embedder.test.assertTrue(e.newWidth >= 200 && e.newWidth <= 210); | 108 embedder.test.assertTrue(e.newWidth >= 200 && e.newWidth <= 210); |
104 embedder.test.assertTrue(e.newHeight >= 100 && e.newHeight <= 110); | 109 embedder.test.assertTrue(e.newHeight >= 100 && e.newHeight <= 110); |
105 embedder.test.succeed(); | 110 embedder.test.succeed(); |
106 }); | 111 }); |
107 | 112 |
108 webview.setAttribute('src', 'data:text/html,webview test sizechanged event'); | 113 webview.setAttribute('src', |
114 util.createDataUrl('webview test sizechanged event')); | |
109 document.body.appendChild(webview); | 115 document.body.appendChild(webview); |
110 } | 116 } |
111 | 117 |
112 // Makes sure 'sizechanged' event is fired only if autosize attribute is | 118 // Makes sure 'sizechanged' event is fired only if autosize attribute is |
113 // specified. | 119 // specified. |
114 // After loading <webview> without autosize attribute and a size, say size1, | 120 // After loading <webview> without autosize attribute and a size, say size1, |
115 // we set autosize attribute and new min size with size2. We would get (only | 121 // we set autosize attribute and new min size with size2. We would get (only |
116 // one) sizechanged event with size1 as old size and size2 as new size. | 122 // one) sizechanged event with size1 as old size and size2 as new size. |
117 function testAutosizeAfterNavigation() { | 123 function testAutosizeAfterNavigation() { |
118 var webview = document.createElement('webview'); | 124 var webview = document.createElement('webview'); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 webview.addEventListener('loadstop', function(e) { | 158 webview.addEventListener('loadstop', function(e) { |
153 webview.setAttribute('autosize', true); | 159 webview.setAttribute('autosize', true); |
154 webview.setAttribute('minwidth', 60); | 160 webview.setAttribute('minwidth', 60); |
155 webview.setAttribute('maxwidth', 70); | 161 webview.setAttribute('maxwidth', 70); |
156 webview.setAttribute('minheight', 110); | 162 webview.setAttribute('minheight', 110); |
157 webview.setAttribute('maxheight', 120); | 163 webview.setAttribute('maxheight', 120); |
158 }); | 164 }); |
159 | 165 |
160 webview.style.width = '50px'; | 166 webview.style.width = '50px'; |
161 webview.style.height = '100px'; | 167 webview.style.height = '100px'; |
162 webview.setAttribute('src', 'data:text/html,webview test sizechanged event'); | 168 webview.setAttribute('src', |
169 util.createDataUrl('webview test sizechanged event')); | |
163 document.body.appendChild(webview); | 170 document.body.appendChild(webview); |
164 } | 171 } |
165 | 172 |
166 // This test verifies that autosize works when some of the parameters are unset. | 173 // This test verifies that autosize works when some of the parameters are unset. |
167 function testAutosizeWithPartialAttributes() { | 174 function testAutosizeWithPartialAttributes() { |
168 window.console.log('testAutosizeWithPartialAttributes'); | 175 window.console.log('testAutosizeWithPartialAttributes'); |
169 var webview = document.createElement('webview'); | 176 var webview = document.createElement('webview'); |
170 | 177 |
171 var step = 1; | 178 var step = 1; |
172 var sizeChangeHandler = function(e) { | 179 var sizeChangeHandler = function(e) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 webview.addEventListener('loadstop', function(e) { | 218 webview.addEventListener('loadstop', function(e) { |
212 webview.minwidth = 300; | 219 webview.minwidth = 300; |
213 webview.maxwidth = 700; | 220 webview.maxwidth = 700; |
214 webview.minheight = 200; | 221 webview.minheight = 200; |
215 webview.maxheight = 600; | 222 webview.maxheight = 600; |
216 webview.autosize = true; | 223 webview.autosize = true; |
217 }); | 224 }); |
218 | 225 |
219 webview.style.width = '640px'; | 226 webview.style.width = '640px'; |
220 webview.style.height = '480px'; | 227 webview.style.height = '480px'; |
221 webview.setAttribute('src', 'data:text/html,webview check autosize'); | 228 webview.setAttribute('src', util.createDataUrl('webview check autosize')); |
222 document.body.appendChild(webview); | 229 document.body.appendChild(webview); |
223 } | 230 } |
224 | 231 |
225 // This test verifies that all autosize attributes can be removed | 232 // This test verifies that all autosize attributes can be removed |
226 // without crashing the plugin, or throwing errors. | 233 // without crashing the plugin, or throwing errors. |
227 function testAutosizeRemoveAttributes() { | 234 function testAutosizeRemoveAttributes() { |
228 var webview = document.createElement('webview'); | 235 var webview = document.createElement('webview'); |
229 | 236 |
230 var step = 1; | 237 var step = 1; |
231 var sizeChangeHandler = function(e) { | 238 var sizeChangeHandler = function(e) { |
(...skipping 26 matching lines...) Expand all Loading... | |
258 webview.maxwidth = 700; | 265 webview.maxwidth = 700; |
259 webview.minheight = 600; | 266 webview.minheight = 600; |
260 webview.maxheight = 400; | 267 webview.maxheight = 400; |
261 webview.autosize = true; | 268 webview.autosize = true; |
262 }); | 269 }); |
263 | 270 |
264 webview.addEventListener('sizechanged', sizeChangeHandler); | 271 webview.addEventListener('sizechanged', sizeChangeHandler); |
265 | 272 |
266 webview.style.width = '640px'; | 273 webview.style.width = '640px'; |
267 webview.style.height = '480px'; | 274 webview.style.height = '480px'; |
268 webview.setAttribute('src', 'data:text/html,webview check autosize'); | 275 webview.setAttribute('src', util.createDataUrl('webview check autosize')); |
269 document.body.appendChild(webview); | 276 document.body.appendChild(webview); |
270 } | 277 } |
271 | 278 |
272 function testAPIMethodExistence() { | 279 function testAPIMethodExistence() { |
273 var apiMethodsToCheck = [ | 280 var apiMethodsToCheck = [ |
274 'back', | 281 'back', |
275 'canGoBack', | 282 'canGoBack', |
276 'canGoForward', | 283 'canGoForward', |
277 'forward', | 284 'forward', |
278 'getProcessId', | 285 'getProcessId', |
279 'go', | 286 'go', |
280 'reload', | 287 'reload', |
281 'stop', | 288 'stop', |
282 'terminate' | 289 'terminate' |
283 ]; | 290 ]; |
284 var webview = document.createElement('webview'); | 291 var webview = document.createElement('webview'); |
285 webview.setAttribute('partition', arguments.callee.name); | 292 webview.setAttribute('partition', arguments.callee.name); |
286 webview.addEventListener('loadstop', function(e) { | 293 webview.addEventListener('loadstop', function(e) { |
287 for (var i = 0; i < apiMethodsToCheck.length; ++i) { | 294 for (var i = 0; i < apiMethodsToCheck.length; ++i) { |
288 embedder.test.assertEq('function', | 295 embedder.test.assertEq('function', |
289 typeof webview[apiMethodsToCheck[i]]); | 296 typeof webview[apiMethodsToCheck[i]]); |
290 } | 297 } |
291 | 298 |
292 // Check contentWindow. | 299 // Check contentWindow. |
293 embedder.test.assertEq('object', typeof webview.contentWindow); | 300 embedder.test.assertEq('object', typeof webview.contentWindow); |
294 embedder.test.assertEq('function', | 301 embedder.test.assertEq('function', |
295 typeof webview.contentWindow.postMessage); | 302 typeof webview.contentWindow.postMessage); |
296 embedder.test.succeed(); | 303 embedder.test.succeed(); |
297 }); | 304 }); |
298 webview.setAttribute('src', 'data:text/html,webview check api'); | 305 webview.setAttribute('src', util.createDataUrl('webview check api')); |
299 document.body.appendChild(webview); | 306 document.body.appendChild(webview); |
300 } | 307 } |
301 | 308 |
302 // This test verifies that the loadstop event fires when loading a webview | 309 // This test verifies that the loadstop event fires when loading a webview |
303 // accessible resource from a partition that is privileged. | 310 // accessible resource from a partition that is privileged. |
304 function testChromeExtensionURL() { | 311 function testChromeExtensionURL() { |
305 var localResource = chrome.runtime.getURL('guest.html'); | 312 var localResource = chrome.runtime.getURL('guest.html'); |
306 var webview = document.createElement('webview'); | 313 var webview = document.createElement('webview'); |
307 // foobar is a privileged partition according to the manifest file. | 314 // foobar is a privileged partition according to the manifest file. |
308 webview.partition = 'foobar'; | 315 webview.partition = 'foobar'; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 embedder.test.assertEq('object', | 357 embedder.test.assertEq('object', |
351 typeof webview[apiPropertiesToCheck[i]]); | 358 typeof webview[apiPropertiesToCheck[i]]); |
352 embedder.test.assertEq( | 359 embedder.test.assertEq( |
353 'function', typeof webview[apiPropertiesToCheck[i]].addListener); | 360 'function', typeof webview[apiPropertiesToCheck[i]].addListener); |
354 embedder.test.assertEq(webview[apiPropertiesToCheck[i]], | 361 embedder.test.assertEq(webview[apiPropertiesToCheck[i]], |
355 webview.request[apiPropertiesToCheck[i]]); | 362 webview.request[apiPropertiesToCheck[i]]); |
356 } | 363 } |
357 | 364 |
358 embedder.test.succeed(); | 365 embedder.test.succeed(); |
359 }); | 366 }); |
360 webview.setAttribute('src', 'data:text/html,webview check api'); | 367 webview.setAttribute('src', util.createDataUrl('webview check api')); |
361 document.body.appendChild(webview); | 368 document.body.appendChild(webview); |
362 } | 369 } |
363 | 370 |
364 // This test verifies that the loadstart, loadstop, and exit events fire as | 371 // This test verifies that the loadstart, loadstop, and exit events fire as |
365 // expected. | 372 // expected. |
366 function testEventName() { | 373 function testEventName() { |
367 var webview = document.createElement('webview'); | 374 var webview = document.createElement('webview'); |
368 webview.setAttribute('partition', arguments.callee.name); | 375 webview.setAttribute('partition', arguments.callee.name); |
369 | 376 |
370 webview.addEventListener('loadstart', function(evt) { | 377 webview.addEventListener('loadstart', function(evt) { |
371 embedder.test.assertEq('loadstart', evt.type); | 378 embedder.test.assertEq('loadstart', evt.type); |
372 }); | 379 }); |
373 | 380 |
374 webview.addEventListener('loadstop', function(evt) { | 381 webview.addEventListener('loadstop', function(evt) { |
375 embedder.test.assertEq('loadstop', evt.type); | 382 embedder.test.assertEq('loadstop', evt.type); |
376 webview.terminate(); | 383 webview.terminate(); |
377 }); | 384 }); |
378 | 385 |
379 webview.addEventListener('exit', function(evt) { | 386 webview.addEventListener('exit', function(evt) { |
380 embedder.test.assertEq('exit', evt.type); | 387 embedder.test.assertEq('exit', evt.type); |
381 embedder.test.succeed(); | 388 embedder.test.succeed(); |
382 }); | 389 }); |
383 | 390 |
384 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 391 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
385 document.body.appendChild(webview); | 392 document.body.appendChild(webview); |
386 } | 393 } |
387 | 394 |
388 function testOnEventProperties() { | 395 function testOnEventProperties() { |
389 var sequence = ['first', 'second', 'third', 'fourth']; | 396 var sequence = ['first', 'second', 'third', 'fourth']; |
390 var webview = document.createElement('webview'); | 397 var webview = document.createElement('webview'); |
391 function createHandler(id) { | 398 function createHandler(id) { |
392 return function(e) { | 399 return function(e) { |
393 embedder.test.assertEq(id, sequence.shift()); | 400 embedder.test.assertEq(id, sequence.shift()); |
394 }; | 401 }; |
395 } | 402 } |
396 | 403 |
397 webview.addEventListener('loadstart', createHandler('first')); | 404 webview.addEventListener('loadstart', createHandler('first')); |
398 webview.addEventListener('loadstart', createHandler('second')); | 405 webview.addEventListener('loadstart', createHandler('second')); |
399 webview.onloadstart = createHandler('third'); | 406 webview.onloadstart = createHandler('third'); |
400 webview.addEventListener('loadstart', createHandler('fourth')); | 407 webview.addEventListener('loadstart', createHandler('fourth')); |
401 webview.addEventListener('loadstop', function(evt) { | 408 webview.addEventListener('loadstop', function(evt) { |
402 embedder.test.assertEq(0, sequence.length); | 409 embedder.test.assertEq(0, sequence.length); |
403 | 410 |
404 // Test that setting another 'onloadstart' handler replaces the previous | 411 // Test that setting another 'onloadstart' handler replaces the previous |
405 // handler. | 412 // handler. |
406 sequence = ['first', 'second', 'fourth']; | 413 sequence = ['first', 'second', 'fourth']; |
407 webview.onloadstart = function() { | 414 webview.onloadstart = function() { |
408 embedder.test.assertEq(0, sequence.length); | 415 embedder.test.assertEq(0, sequence.length); |
409 embedder.test.succeed(); | 416 embedder.test.succeed(); |
410 }; | 417 }; |
411 | 418 |
412 webview.setAttribute('src', 'data:text/html,next navigation'); | 419 webview.setAttribute('src', util.createDataUrl('next navigation')); |
413 }); | 420 }); |
414 | 421 |
415 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 422 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
416 document.body.appendChild(webview); | 423 document.body.appendChild(webview); |
417 } | 424 } |
418 | 425 |
419 // Tests that the 'loadprogress' event is triggered correctly. | 426 // Tests that the 'loadprogress' event is triggered correctly. |
420 function testLoadProgressEvent() { | 427 function testLoadProgressEvent() { |
421 var webview = document.createElement('webview'); | 428 var webview = document.createElement('webview'); |
422 var progress = 0; | 429 var progress = 0; |
423 | 430 |
424 webview.addEventListener('loadstop', function(evt) { | 431 webview.addEventListener('loadstop', function(evt) { |
425 embedder.test.assertEq(1, progress); | 432 embedder.test.assertEq(1, progress); |
426 embedder.test.succeed(); | 433 embedder.test.succeed(); |
427 }); | 434 }); |
428 | 435 |
429 webview.addEventListener('loadprogress', function(evt) { | 436 webview.addEventListener('loadprogress', function(evt) { |
430 progress = evt.progress; | 437 progress = evt.progress; |
431 }); | 438 }); |
432 | 439 |
433 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 440 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
434 document.body.appendChild(webview); | 441 document.body.appendChild(webview); |
435 } | 442 } |
436 | 443 |
437 // This test registers two listeners on an event (loadcommit) and removes | 444 // This test registers two listeners on an event (loadcommit) and removes |
438 // the <webview> tag when the first listener fires. | 445 // the <webview> tag when the first listener fires. |
439 // Current expected behavior is that the second event listener will still | 446 // Current expected behavior is that the second event listener will still |
440 // fire without crashing. | 447 // fire without crashing. |
441 function testDestroyOnEventListener() { | 448 function testDestroyOnEventListener() { |
442 var webview = util.createWebViewTagInDOM(arguments.callee.name); | 449 var webview = util.createWebViewTagInDOM(arguments.callee.name); |
443 var url = 'data:text/html,<body>Destroy test</body>'; | 450 var url = util.createDataUrl('<body>Destroy test</body>'); |
444 | 451 |
445 var loadCommitCount = 0; | 452 var loadCommitCount = 0; |
446 function loadCommitCommon(e) { | 453 function loadCommitCommon(e) { |
447 embedder.test.assertEq('loadcommit', e.type); | 454 embedder.test.assertEq('loadcommit', e.type); |
448 if (url != e.url) | 455 if (url != e.url) |
449 return; | 456 return; |
450 ++loadCommitCount; | 457 ++loadCommitCount; |
451 if (loadCommitCount == 1) { | 458 if (loadCommitCount == 1) { |
452 setTimeout(function() { | 459 setTimeout(function() { |
453 embedder.test.succeed(); | 460 embedder.test.succeed(); |
(...skipping 12 matching lines...) Expand all Loading... | |
466 loadCommitCommon(e); | 473 loadCommitCommon(e); |
467 }); | 474 }); |
468 webview.setAttribute('src', url); | 475 webview.setAttribute('src', url); |
469 } | 476 } |
470 | 477 |
471 // This test registers two event listeners on a same event (loadcommit). | 478 // This test registers two event listeners on a same event (loadcommit). |
472 // Each of the listener tries to change some properties on the event param, | 479 // Each of the listener tries to change some properties on the event param, |
473 // which should not be possible. | 480 // which should not be possible. |
474 function testCannotMutateEventName() { | 481 function testCannotMutateEventName() { |
475 var webview = util.createWebViewTagInDOM(arguments.callee.name); | 482 var webview = util.createWebViewTagInDOM(arguments.callee.name); |
476 var url = 'data:text/html,<body>Two</body>'; | 483 var url = util.createDataUrl('<body>Two</body>'); |
477 | 484 |
478 var loadCommitACalled = false; | 485 var loadCommitACalled = false; |
479 var loadCommitBCalled = false; | 486 var loadCommitBCalled = false; |
480 | 487 |
481 var maybeFinishTest = function(e) { | 488 var maybeFinishTest = function(e) { |
482 if (loadCommitACalled && loadCommitBCalled) { | 489 if (loadCommitACalled && loadCommitBCalled) { |
483 embedder.test.assertEq('loadcommit', e.type); | 490 embedder.test.assertEq('loadcommit', e.type); |
484 embedder.test.succeed(); | 491 embedder.test.succeed(); |
485 } | 492 } |
486 }; | 493 }; |
(...skipping 27 matching lines...) Expand all Loading... | |
514 webview.addEventListener('loadcommit', onLoadCommitA); | 521 webview.addEventListener('loadcommit', onLoadCommitA); |
515 webview.addEventListener('loadcommit', onLoadCommitB); | 522 webview.addEventListener('loadcommit', onLoadCommitB); |
516 webview.setAttribute('src', url); | 523 webview.setAttribute('src', url); |
517 } | 524 } |
518 | 525 |
519 // This test verifies that setting the partition attribute after the src has | 526 // This test verifies that setting the partition attribute after the src has |
520 // been set raises an exception. | 527 // been set raises an exception. |
521 function testPartitionRaisesException() { | 528 function testPartitionRaisesException() { |
522 var webview = document.createElement('webview'); | 529 var webview = document.createElement('webview'); |
523 webview.setAttribute('partition', arguments.callee.name); | 530 webview.setAttribute('partition', arguments.callee.name); |
524 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 531 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
525 document.body.appendChild(webview); | 532 document.body.appendChild(webview); |
526 setTimeout(function() { | 533 setTimeout(function() { |
527 try { | 534 try { |
528 webview.partition = 'illegal'; | 535 webview.partition = 'illegal'; |
529 embedder.test.fail(); | 536 embedder.test.fail(); |
530 } catch (e) { | 537 } catch (e) { |
531 embedder.test.succeed(); | 538 embedder.test.succeed(); |
532 } | 539 } |
533 }, 0); | 540 }, 0); |
534 } | 541 } |
(...skipping 19 matching lines...) Expand all Loading... | |
554 webview.setAttribute('partition', arguments.callee.name); | 561 webview.setAttribute('partition', arguments.callee.name); |
555 webview.addEventListener('loadstop', function() { | 562 webview.addEventListener('loadstop', function() { |
556 webview.executeScript( | 563 webview.executeScript( |
557 {code:'document.body.style.backgroundColor = "red";'}, | 564 {code:'document.body.style.backgroundColor = "red";'}, |
558 function(results) { | 565 function(results) { |
559 embedder.test.assertEq(1, results.length); | 566 embedder.test.assertEq(1, results.length); |
560 embedder.test.assertEq('red', results[0]); | 567 embedder.test.assertEq('red', results[0]); |
561 embedder.test.succeed(); | 568 embedder.test.succeed(); |
562 }); | 569 }); |
563 }); | 570 }); |
564 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 571 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
565 document.body.appendChild(webview); | 572 document.body.appendChild(webview); |
566 } | 573 } |
567 | 574 |
568 // This test calls terminate() on guest after it has already been | 575 // This test calls terminate() on guest after it has already been |
569 // terminated. This makes sure we ignore the call gracefully. | 576 // terminated. This makes sure we ignore the call gracefully. |
570 function testTerminateAfterExit() { | 577 function testTerminateAfterExit() { |
571 var webview = document.createElement('webview'); | 578 var webview = document.createElement('webview'); |
572 webview.setAttribute('partition', arguments.callee.name); | 579 webview.setAttribute('partition', arguments.callee.name); |
573 var loadstopSucceedsTest = false; | 580 var loadstopSucceedsTest = false; |
574 webview.addEventListener('loadstop', function(evt) { | 581 webview.addEventListener('loadstop', function(evt) { |
575 embedder.test.assertEq('loadstop', evt.type); | 582 embedder.test.assertEq('loadstop', evt.type); |
576 if (loadstopSucceedsTest) { | 583 if (loadstopSucceedsTest) { |
577 embedder.test.succeed(); | 584 embedder.test.succeed(); |
578 return; | 585 return; |
579 } | 586 } |
580 | 587 |
581 webview.terminate(); | 588 webview.terminate(); |
582 }); | 589 }); |
583 | 590 |
584 webview.addEventListener('exit', function(evt) { | 591 webview.addEventListener('exit', function(evt) { |
585 embedder.test.assertEq('exit', evt.type); | 592 embedder.test.assertEq('exit', evt.type); |
586 // Call terminate again. | 593 // Call terminate again. |
587 webview.terminate(); | 594 webview.terminate(); |
588 // Load another page. The test would pass when loadstop is called on | 595 // Load another page. The test would pass when loadstop is called on |
589 // this second page. This would hopefully catch if call to | 596 // this second page. This would hopefully catch if call to |
590 // webview.terminate() caused a browser crash. | 597 // webview.terminate() caused a browser crash. |
591 setTimeout(function() { | 598 setTimeout(function() { |
592 loadstopSucceedsTest = true; | 599 loadstopSucceedsTest = true; |
593 webview.setAttribute('src', 'data:text/html,test second page'); | 600 webview.setAttribute('src', util.createDataUrl('test second page')); |
594 }, 0); | 601 }, 0); |
595 }); | 602 }); |
596 | 603 |
597 webview.setAttribute('src', 'data:text/html,test terminate() crash.'); | 604 webview.setAttribute('src', util.createDataUrl('test terminate() crash.')); |
598 document.body.appendChild(webview); | 605 document.body.appendChild(webview); |
599 } | 606 } |
600 | 607 |
601 // This test verifies that multiple consecutive changes to the <webview> src | 608 // This test verifies that multiple consecutive changes to the <webview> src |
602 // attribute will cause a navigation. | 609 // attribute will cause a navigation. |
603 function testNavOnConsecutiveSrcAttributeChanges() { | 610 function testNavOnConsecutiveSrcAttributeChanges() { |
604 var testPage1 = 'data:text/html,test page 1'; | 611 var testPage1 = util.createDataUrl('test page 1'); |
605 var testPage2 = 'data:text/html,test page 2'; | 612 var testPage2 = util.createDataUrl('test page 2'); |
606 var testPage3 = 'data:text/html,test page 3'; | 613 var testPage3 = util.createDataUrl('test page 3'); |
607 var webview = new WebView(); | 614 var webview = new WebView(); |
608 webview.partition = arguments.callee.name; | 615 webview.partition = arguments.callee.name; |
609 var loadCommitCount = 0; | 616 var loadCommitCount = 0; |
610 webview.addEventListener('loadcommit', function(e) { | 617 webview.addEventListener('loadcommit', function(e) { |
611 if (e.url == testPage3) { | 618 if (e.url == testPage3) { |
612 embedder.test.succeed(); | 619 embedder.test.succeed(); |
613 } | 620 } |
614 loadCommitCount++; | 621 loadCommitCount++; |
615 if (loadCommitCount > 3) { | 622 if (loadCommitCount > 3) { |
616 embedder.test.fail(); | 623 embedder.test.fail(); |
617 } | 624 } |
618 }); | 625 }); |
619 document.body.appendChild(webview); | 626 document.body.appendChild(webview); |
620 webview.src = testPage1; | 627 webview.src = testPage1; |
621 webview.src = testPage2; | 628 webview.src = testPage2; |
622 webview.src = testPage3; | 629 webview.src = testPage3; |
623 } | 630 } |
624 | 631 |
625 // This test verifies that we can set the <webview> src multiple times and the | 632 // This test verifies that we can set the <webview> src multiple times and the |
626 // changes will cause a navigation. | 633 // changes will cause a navigation. |
627 function testNavOnSrcAttributeChange() { | 634 function testNavOnSrcAttributeChange() { |
628 var testPage1 = 'data:text/html,test page 1'; | 635 var testPage1 = util.createDataUrl('test page 1'); |
629 var testPage2 = 'data:text/html,test page 2'; | 636 var testPage2 = util.createDataUrl('test page 2'); |
630 var testPage3 = 'data:text/html,test page 3'; | 637 var testPage3 = util.createDataUrl('test page 3'); |
631 var tests = [testPage1, testPage2, testPage3]; | 638 var tests = [testPage1, testPage2, testPage3]; |
632 var webview = new WebView(); | 639 var webview = new WebView(); |
633 webview.partition = arguments.callee.name; | 640 webview.partition = arguments.callee.name; |
634 var loadCommitCount = 0; | 641 var loadCommitCount = 0; |
635 webview.addEventListener('loadcommit', function(evt) { | 642 webview.addEventListener('loadcommit', function(evt) { |
636 var success = tests.indexOf(evt.url) > -1; | 643 var success = tests.indexOf(evt.url) > -1; |
637 embedder.test.assertTrue(success); | 644 embedder.test.assertTrue(success); |
638 ++loadCommitCount; | 645 ++loadCommitCount; |
639 if (loadCommitCount == tests.length) { | 646 if (loadCommitCount == tests.length) { |
640 embedder.test.succeed(); | 647 embedder.test.succeed(); |
(...skipping 16 matching lines...) Expand all Loading... | |
657 webview.addEventListener('loadstop', function(evt) { | 664 webview.addEventListener('loadstop', function(evt) { |
658 if (!terminated) { | 665 if (!terminated) { |
659 webview.terminate(); | 666 webview.terminate(); |
660 return; | 667 return; |
661 } | 668 } |
662 // The guest has recovered after being terminated. | 669 // The guest has recovered after being terminated. |
663 embedder.test.succeed(); | 670 embedder.test.succeed(); |
664 }); | 671 }); |
665 webview.addEventListener('exit', function(evt) { | 672 webview.addEventListener('exit', function(evt) { |
666 terminated = true; | 673 terminated = true; |
667 webview.setAttribute('src', 'data:text/html,test page'); | 674 webview.setAttribute('src', util.createDataUrl('test page')); |
668 }); | 675 }); |
669 webview.setAttribute('src', 'data:text/html,test page'); | 676 webview.setAttribute('src', util.createDataUrl('test page')); |
670 document.body.appendChild(webview); | 677 document.body.appendChild(webview); |
671 } | 678 } |
672 | 679 |
673 // This test verifies that <webview> reloads the page if the src attribute is | 680 // This test verifies that <webview> reloads the page if the src attribute is |
674 // assigned the same value. | 681 // assigned the same value. |
675 function testReassignSrcAttribute() { | 682 function testReassignSrcAttribute() { |
676 var dataUrl = 'data:text/html,test page'; | 683 var dataUrl = util.createDataUrl('test page'); |
677 var webview = new WebView(); | 684 var webview = new WebView(); |
678 webview.partition = arguments.callee.name; | 685 webview.partition = arguments.callee.name; |
679 | 686 |
680 var loadStopCount = 0; | 687 var loadStopCount = 0; |
681 webview.addEventListener('loadstop', function(evt) { | 688 webview.addEventListener('loadstop', function(evt) { |
682 embedder.test.assertEq(dataUrl, webview.getAttribute('src')); | 689 embedder.test.assertEq(dataUrl, webview.getAttribute('src')); |
683 ++loadStopCount; | 690 ++loadStopCount; |
684 console.log('[' + loadStopCount + '] loadstop called'); | 691 console.log('[' + loadStopCount + '] loadstop called'); |
685 if (loadStopCount == 3) { | 692 if (loadStopCount == 3) { |
686 embedder.test.succeed(); | 693 embedder.test.succeed(); |
687 } else if (loadStopCount > 3) { | 694 } else if (loadStopCount > 3) { |
688 embedder.test.fail(); | 695 embedder.test.fail(); |
689 } else { | 696 } else { |
690 webview.src = dataUrl; | 697 webview.src = dataUrl; |
691 } | 698 } |
692 }); | 699 }); |
693 webview.src = dataUrl; | 700 webview.src = dataUrl; |
694 document.body.appendChild(webview); | 701 document.body.appendChild(webview); |
695 } | 702 } |
696 | 703 |
697 // This test verifies that <webview> restores the src attribute if it is | 704 // This test verifies that <webview> restores the src attribute if it is |
698 // removed after navigation. | 705 // removed after navigation. |
699 function testRemoveSrcAttribute() { | 706 function testRemoveSrcAttribute() { |
700 var dataUrl = 'data:text/html,test page'; | 707 var dataUrl = util.createDataUrl('test page'); |
701 var webview = document.createElement('webview'); | 708 var webview = document.createElement('webview'); |
702 webview.setAttribute('partition', arguments.callee.name); | 709 webview.setAttribute('partition', arguments.callee.name); |
703 var terminated = false; | 710 var terminated = false; |
704 webview.addEventListener('loadstop', function(evt) { | 711 webview.addEventListener('loadstop', function(evt) { |
705 webview.removeAttribute('src'); | 712 webview.removeAttribute('src'); |
706 setTimeout(function() { | 713 setTimeout(function() { |
707 embedder.test.assertEq(dataUrl, webview.getAttribute('src')); | 714 embedder.test.assertEq(dataUrl, webview.getAttribute('src')); |
joth
2013/11/01 06:32:54
this is the sort of statement that fails without m
| |
708 embedder.test.succeed(); | 715 embedder.test.succeed(); |
709 }, 0); | 716 }, 0); |
710 }); | 717 }); |
711 webview.setAttribute('src', dataUrl); | 718 webview.setAttribute('src', dataUrl); |
712 document.body.appendChild(webview); | 719 document.body.appendChild(webview); |
713 } | 720 } |
714 | 721 |
715 // This test verifies that it is not possible to instantiate a browser plugin | 722 // This test verifies that it is not possible to instantiate a browser plugin |
716 // directly within an app. | 723 // directly within an app. |
717 function testBrowserPluginNotAllowed() { | 724 function testBrowserPluginNotAllowed() { |
(...skipping 25 matching lines...) Expand all Loading... | |
743 var webview = document.createElement('webview'); | 750 var webview = document.createElement('webview'); |
744 webview.addEventListener('permissionrequest', function(e) { | 751 webview.addEventListener('permissionrequest', function(e) { |
745 e.preventDefault(); | 752 e.preventDefault(); |
746 embedder.test.assertEq('loadplugin', e.permission); | 753 embedder.test.assertEq('loadplugin', e.permission); |
747 embedder.test.assertEq(pluginIdentifier, e.name); | 754 embedder.test.assertEq(pluginIdentifier, e.name); |
748 embedder.test.assertEq(pluginIdentifier, e.identifier); | 755 embedder.test.assertEq(pluginIdentifier, e.identifier); |
749 embedder.test.assertEq('function', typeof e.request.allow); | 756 embedder.test.assertEq('function', typeof e.request.allow); |
750 embedder.test.assertEq('function', typeof e.request.deny); | 757 embedder.test.assertEq('function', typeof e.request.deny); |
751 embedder.test.succeed(); | 758 embedder.test.succeed(); |
752 }); | 759 }); |
753 webview.setAttribute('src', 'data:text/html,<body>' + | 760 webview.setAttribute('src', util.createDataUrl('<body>' + |
754 '<embed type="application/x-ppapi-tests">' + | 761 '<embed type="application/x-ppapi-tests">' + |
755 '</embed></body>'); | 762 '</embed></body>')); |
756 document.body.appendChild(webview); | 763 document.body.appendChild(webview); |
757 } | 764 } |
758 | 765 |
759 // This test verifies that new window attachment functions as expected. | 766 // This test verifies that new window attachment functions as expected. |
760 function testNewWindow() { | 767 function testNewWindow() { |
761 var webview = document.createElement('webview'); | 768 var webview = document.createElement('webview'); |
762 webview.addEventListener('newwindow', function(e) { | 769 webview.addEventListener('newwindow', function(e) { |
763 e.preventDefault(); | 770 e.preventDefault(); |
764 var newwebview = document.createElement('webview'); | 771 var newwebview = document.createElement('webview'); |
765 newwebview.addEventListener('loadstop', function(evt) { | 772 newwebview.addEventListener('loadstop', function(evt) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 | 847 |
841 // This test verifies that the load event fires when the a new page is | 848 // This test verifies that the load event fires when the a new page is |
842 // loaded. | 849 // loaded. |
843 // TODO(fsamuel): Add a test to verify that subframe loads within a guest | 850 // TODO(fsamuel): Add a test to verify that subframe loads within a guest |
844 // do not fire the 'contentload' event. | 851 // do not fire the 'contentload' event. |
845 function testContentLoadEvent() { | 852 function testContentLoadEvent() { |
846 var webview = document.createElement('webview'); | 853 var webview = document.createElement('webview'); |
847 webview.addEventListener('contentload', function(e) { | 854 webview.addEventListener('contentload', function(e) { |
848 embedder.test.succeed(); | 855 embedder.test.succeed(); |
849 }); | 856 }); |
850 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 857 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
851 document.body.appendChild(webview); | 858 document.body.appendChild(webview); |
852 } | 859 } |
853 | 860 |
854 // This test verifies that the WebRequest API onBeforeRequest event fires on | 861 // This test verifies that the WebRequest API onBeforeRequest event fires on |
855 // webview. | 862 // webview. |
856 function testWebRequestAPI() { | 863 function testWebRequestAPI() { |
857 var webview = new WebView(); | 864 var webview = new WebView(); |
858 webview.request.onBeforeRequest.addListener(function(e) { | 865 webview.request.onBeforeRequest.addListener(function(e) { |
859 embedder.test.succeed(); | 866 embedder.test.succeed(); |
860 }, { urls: ['<all_urls>']}) ; | 867 }, { urls: ['<all_urls>']}) ; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
896 }; | 903 }; |
897 webview.addEventListener('loadstop', onLoadStop); | 904 webview.addEventListener('loadstop', onLoadStop); |
898 webview.src = embedder.emptyGuestURL; | 905 webview.src = embedder.emptyGuestURL; |
899 document.body.appendChild(webview); | 906 document.body.appendChild(webview); |
900 } | 907 } |
901 | 908 |
902 // This test verifies that getProcessId is defined and returns a non-zero | 909 // This test verifies that getProcessId is defined and returns a non-zero |
903 // value corresponding to the processId of the guest process. | 910 // value corresponding to the processId of the guest process. |
904 function testGetProcessId() { | 911 function testGetProcessId() { |
905 var webview = document.createElement('webview'); | 912 var webview = document.createElement('webview'); |
906 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 913 webview.setAttribute('src', util.createDataUrl('trigger navigation')); |
907 var firstLoad = function() { | 914 var firstLoad = function() { |
908 webview.removeEventListener('loadstop', firstLoad); | 915 webview.removeEventListener('loadstop', firstLoad); |
909 embedder.test.assertTrue(webview.getProcessId() > 0); | 916 embedder.test.assertTrue(webview.getProcessId() > 0); |
910 embedder.test.succeed(); | 917 embedder.test.succeed(); |
911 }; | 918 }; |
912 webview.addEventListener('loadstop', firstLoad); | 919 webview.addEventListener('loadstop', firstLoad); |
913 document.body.appendChild(webview); | 920 document.body.appendChild(webview); |
914 } | 921 } |
915 | 922 |
916 // This test verifies that the loadstart event fires at the beginning of a load | 923 // This test verifies that the loadstart event fires at the beginning of a load |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
999 webview.addEventListener('loadabort', function(e) { | 1006 webview.addEventListener('loadabort', function(e) { |
1000 embedder.test.assertEq('ERR_ABORTED', e.reason); | 1007 embedder.test.assertEq('ERR_ABORTED', e.reason); |
1001 embedder.test.succeed(); | 1008 embedder.test.succeed(); |
1002 }); | 1009 }); |
1003 webview.setAttribute('src', 'javascript:void(document.bgColor="#0000FF")'); | 1010 webview.setAttribute('src', 'javascript:void(document.bgColor="#0000FF")'); |
1004 document.body.appendChild(webview); | 1011 document.body.appendChild(webview); |
1005 } | 1012 } |
1006 | 1013 |
1007 // This test verifies that the reload method on webview functions as expected. | 1014 // This test verifies that the reload method on webview functions as expected. |
1008 function testReload() { | 1015 function testReload() { |
1009 var triggerNavUrl = 'data:text/html,trigger navigation'; | 1016 var triggerNavUrl = util.createDataUrl('trigger navigation'); |
1010 var webview = document.createElement('webview'); | 1017 var webview = document.createElement('webview'); |
1011 | 1018 |
1012 var loadCommitCount = 0; | 1019 var loadCommitCount = 0; |
1013 webview.addEventListener('loadstop', function(e) { | 1020 webview.addEventListener('loadstop', function(e) { |
1014 if (loadCommitCount < 2) { | 1021 if (loadCommitCount < 2) { |
1015 webview.reload(); | 1022 webview.reload(); |
1016 } else if (loadCommitCount == 2) { | 1023 } else if (loadCommitCount == 2) { |
1017 embedder.test.succeed(); | 1024 embedder.test.succeed(); |
1018 } else { | 1025 } else { |
1019 embedder.test.fail(); | 1026 embedder.test.fail(); |
1020 } | 1027 } |
1021 }); | 1028 }); |
1022 webview.addEventListener('loadcommit', function(e) { | 1029 webview.addEventListener('loadcommit', function(e) { |
1023 embedder.test.assertEq(triggerNavUrl, e.url); | 1030 embedder.test.assertEq(triggerNavUrl, e.url); |
1024 embedder.test.assertTrue(e.isTopLevel); | 1031 embedder.test.assertTrue(e.isTopLevel); |
1025 loadCommitCount++; | 1032 loadCommitCount++; |
1026 }); | 1033 }); |
1027 | 1034 |
1028 webview.setAttribute('src', triggerNavUrl); | 1035 webview.setAttribute('src', triggerNavUrl); |
1029 document.body.appendChild(webview); | 1036 document.body.appendChild(webview); |
1030 } | 1037 } |
1031 | 1038 |
1032 // This test verifies that a <webview> is torn down gracefully when removed from | 1039 // This test verifies that a <webview> is torn down gracefully when removed from |
1033 // the DOM on exit. | 1040 // the DOM on exit. |
1034 | 1041 |
1035 window.removeWebviewOnExitDoCrash = null; | 1042 window.removeWebviewOnExitDoCrash = null; |
1036 | 1043 |
1037 function testRemoveWebviewOnExit() { | 1044 function testRemoveWebviewOnExit() { |
1038 var triggerNavUrl = 'data:text/html,trigger navigation'; | 1045 var triggerNavUrl = util.createDataUrl('trigger navigation'); |
1039 var webview = document.createElement('webview'); | 1046 var webview = document.createElement('webview'); |
1040 | 1047 |
1041 webview.addEventListener('loadstop', function(e) { | 1048 webview.addEventListener('loadstop', function(e) { |
1042 chrome.test.sendMessage('guest-loaded'); | 1049 chrome.test.sendMessage('guest-loaded'); |
1043 }); | 1050 }); |
1044 | 1051 |
1045 window.removeWebviewOnExitDoCrash = function() { | 1052 window.removeWebviewOnExitDoCrash = function() { |
1046 webview.terminate(); | 1053 webview.terminate(); |
1047 }; | 1054 }; |
1048 | 1055 |
1049 webview.addEventListener('exit', function(e) { | 1056 webview.addEventListener('exit', function(e) { |
1050 // We expected to be killed. | 1057 // We expected to be killed. |
1051 if (e.reason != 'killed') { | 1058 if (e.reason != 'killed') { |
1052 console.log('EXPECTED TO BE KILLED!'); | 1059 console.log('EXPECTED TO BE KILLED!'); |
1053 return; | 1060 return; |
1054 } | 1061 } |
1055 webview.parentNode.removeChild(webview); | 1062 webview.parentNode.removeChild(webview); |
1056 }); | 1063 }); |
1057 | 1064 |
1058 // Trigger a navigation to create a guest process. | 1065 // Trigger a navigation to create a guest process. |
1059 webview.setAttribute('src', embedder.emptyGuestURL); | 1066 webview.setAttribute('src', embedder.emptyGuestURL); |
1060 document.body.appendChild(webview); | 1067 document.body.appendChild(webview); |
1061 } | 1068 } |
1062 | 1069 |
1063 function testRemoveWebviewAfterNavigation() { | 1070 function testRemoveWebviewAfterNavigation() { |
1064 var webview = new WebView(); | 1071 var webview = new WebView(); |
1065 document.body.appendChild(webview); | 1072 document.body.appendChild(webview); |
1066 webview.src = 'data:text/html,trigger navigation'; | 1073 webview.src = util.createDataUrl('trigger navigation'); |
1067 document.body.removeChild(webview); | 1074 document.body.removeChild(webview); |
1068 setTimeout(function() { | 1075 setTimeout(function() { |
1069 embedder.test.succeed(); | 1076 embedder.test.succeed(); |
1070 }, 0); | 1077 }, 0); |
1071 } | 1078 } |
1072 | 1079 |
1073 function testNavigationToExternalProtocol() { | 1080 function testNavigationToExternalProtocol() { |
1074 var webview = document.createElement('webview'); | 1081 var webview = document.createElement('webview'); |
1075 webview.addEventListener('loadstop', function(e) { | 1082 webview.addEventListener('loadstop', function(e) { |
1076 webview.addEventListener('loadabort', function(e) { | 1083 webview.addEventListener('loadabort', function(e) { |
1077 embedder.test.assertEq('ERR_UNKNOWN_URL_SCHEME', e.reason); | 1084 embedder.test.assertEq('ERR_UNKNOWN_URL_SCHEME', e.reason); |
1078 embedder.test.succeed(); | 1085 embedder.test.succeed(); |
1079 }); | 1086 }); |
1080 webview.executeScript({ | 1087 webview.executeScript({ |
1081 code: 'window.location.href = "tel:+12223334444";' | 1088 code: 'window.location.href = "tel:+12223334444";' |
1082 }, function(results) {}); | 1089 }, function(results) {}); |
1083 }); | 1090 }); |
1084 webview.setAttribute('src', 'data:text/html,navigate to external protocol'); | 1091 webview.setAttribute('src', |
1092 util.createDataUrl('navigate to external protocol')); | |
1085 document.body.appendChild(webview); | 1093 document.body.appendChild(webview); |
1086 } | 1094 } |
1087 | 1095 |
1088 function testResizeWebviewResizesContent() { | 1096 function testResizeWebviewResizesContent() { |
1089 var triggerNavUrl = 'data:text/html,trigger navigation'; | 1097 var triggerNavUrl = util.createDataUrl('trigger navigation'); |
1090 var webview = new WebView(); | 1098 var webview = new WebView(); |
1091 webview.src = triggerNavUrl; | 1099 webview.src = triggerNavUrl; |
1092 webview.addEventListener('loadstop', function(e) { | 1100 webview.addEventListener('loadstop', function(e) { |
1093 webview.executeScript( | 1101 webview.executeScript( |
1094 {file: 'inject_resize_test.js'}, | 1102 {file: 'inject_resize_test.js'}, |
1095 function(results) { | 1103 function(results) { |
1096 console.log('Script has been injected into webview.'); | 1104 console.log('Script has been injected into webview.'); |
1097 // Establish a communication channel with the guest. | 1105 // Establish a communication channel with the guest. |
1098 var msg = ['connect']; | 1106 var msg = ['connect']; |
1099 webview.contentWindow.postMessage(JSON.stringify(msg), '*'); | 1107 webview.contentWindow.postMessage(JSON.stringify(msg), '*'); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1171 'testRemoveWebviewAfterNavigation': testRemoveWebviewAfterNavigation, | 1179 'testRemoveWebviewAfterNavigation': testRemoveWebviewAfterNavigation, |
1172 'testResizeWebviewResizesContent': testResizeWebviewResizesContent | 1180 'testResizeWebviewResizesContent': testResizeWebviewResizesContent |
1173 }; | 1181 }; |
1174 | 1182 |
1175 onload = function() { | 1183 onload = function() { |
1176 chrome.test.getConfig(function(config) { | 1184 chrome.test.getConfig(function(config) { |
1177 embedder.setUp_(config); | 1185 embedder.setUp_(config); |
1178 chrome.test.sendMessage("Launched"); | 1186 chrome.test.sendMessage("Launched"); |
1179 }); | 1187 }); |
1180 }; | 1188 }; |
OLD | NEW |