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

Side by Side Diff: trunk/src/chrome/test/data/extensions/api_test/executescript/callback/test.js

Issue 16511004: Revert 205184 "Revert 204057 "Recurse to a maximum depth of 10 i..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/content/renderer/v8_value_converter_impl.h » ('j') | 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) 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 relativePath = 5 var relativePath =
6 '/files/extensions/api_test/executescript/callback/test.html'; 6 '/files/extensions/api_test/executescript/callback/test.html';
7 var testUrl = 'http://b.com:PORT' + relativePath; 7 var testUrl = 'http://b.com:PORT' + relativePath;
8 8
9 chrome.test.getConfig(function(config) { 9 chrome.test.getConfig(function(config) {
10 testUrl = testUrl.replace(/PORT/, config.testServer.port); 10 testUrl = testUrl.replace(/PORT/, config.testServer.port);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 function executeCallbackObjShouldSucceed() { 80 function executeCallbackObjShouldSucceed() {
81 var scriptDetails = {code: 'var obj = {"id": "foo", "bar": 9}; obj'}; 81 var scriptDetails = {code: 'var obj = {"id": "foo", "bar": 9}; obj'};
82 chrome.tabs.executeScript(tabId, scriptDetails, function(scriptVal) { 82 chrome.tabs.executeScript(tabId, scriptDetails, function(scriptVal) {
83 chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) { 83 chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) {
84 chrome.test.assertEq({"id": "foo", "bar": 9}, scriptVal[0]); 84 chrome.test.assertEq({"id": "foo", "bar": 9}, scriptVal[0]);
85 })); 85 }));
86 }); 86 });
87 }, 87 },
88 88
89 // Non-pure ojbects (like DOM nodes) will get converted as best they can. 89 // Non-pure object (like DOM nodes) will get converted as best they can.
90 function executeCallbackDOMObjShouldSucceed() { 90 function executeCallbackDOMObjShouldSucceed() {
91 var scriptDetails = {}; 91 var scriptDetails = {};
92 scriptDetails.code = 'var a = document.getElementById("testDiv"); a;'; 92 scriptDetails.code = 'var a = document.getElementById("testDiv"); a;';
93 chrome.tabs.executeScript(tabId, scriptDetails, function(scriptVal) { 93 chrome.tabs.executeScript(tabId, scriptDetails, function(scriptVal) {
94 chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) { 94 chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) {
95 // Test passes as long as the DOM node was converted in some form 95 // Test passes as long as the DOM node was converted in some form
96 // and is not null 96 // and is not null
97 chrome.test.assertTrue(scriptVal[0] != null); 97 chrome.test.assertTrue(scriptVal[0] != null);
98 })); 98 }));
99 }); 99 });
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // form and is not null 159 // form and is not null
160 chrome.test.assertTrue(scriptVal[0] != null); 160 chrome.test.assertTrue(scriptVal[0] != null);
161 })); 161 }));
162 }); 162 });
163 } 163 }
164 ]); 164 ]);
165 }); 165 });
166 chrome.tabs.create({ url: testUrl }); 166 chrome.tabs.create({ url: testUrl });
167 167
168 }); 168 });
OLDNEW
« no previous file with comments | « no previous file | trunk/src/content/renderer/v8_value_converter_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698