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

Side by Side Diff: chrome/test/data/extensions/platform_apps/extension_view/connect_api/main.js

Issue 913393003: Restrict extensionview to chrome-extension:// (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var checkExtension = function(element, expectedValue) {
6 chrome.test.assertEq(expectedValue, element.extension);
7 };
8
9 var checkSrc = function(element, expectedValue) {
10 chrome.test.assertEq(expectedValue, element.src);
11 };
12
13 onload = function() {
14 chrome.test.runTests([
15 function extensionView() {
16 var firstExtensionId = 'firstExtensionId';
17 var secondExtensionId = 'secondExtensionId';
18 var firstSrc = 'data:text/html,<body>One</body>';
19 var secondSrc = 'data:text/html,<body>One</body>';
20
21 var extensionview = document.querySelector('extensionview');
22 // Call connect with an initial extension Id and src.
23 extensionview.connect(firstExtensionId, firstSrc);
24 checkExtension(extensionview, firstExtensionId);
25 checkSrc(extensionview, firstSrc);
26
27 // Call connect with the same extension Id and src.
28 extensionview.connect(firstExtensionId, firstSrc);
29 checkExtension(extensionview, firstExtensionId);
30 checkSrc(extensionview, firstSrc);
31
32 // Call connect with the same extension Id and different src.
33 extensionview.connect(firstExtensionId, secondSrc);
34 checkExtension(extensionview, firstExtensionId);
35 checkSrc(extensionview, secondSrc);
36
37 // Call connect with a new extension Id and src.
38 extensionview.connect(secondExtensionId, firstSrc);
39 checkExtension(extensionview, secondExtensionId);
40 checkSrc(extensionview, firstSrc);
41
42 // Call setAttribute with a different src.
43 extensionview.setAttribute('src', secondSrc);
44 checkExtension(extensionview, secondExtensionId);
45 checkSrc(extensionview, secondSrc);
46 chrome.test.succeed();
47 }
48 ]);
49 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698