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

Side by Side Diff: chrome/test/data/extensions/webui/sanity_check_available_apis.js

Issue 411733002: WIP: diff which plumbs through the event URL. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // out/Debug/browser_tests \ 5 // out/Debug/browser_tests \
6 // --gtest_filter=ExtensionWebUITest.SanityCheckAvailableAPIs 6 // --gtest_filter=ExtensionWebUITest.SanityCheckAvailableAPIs
7 7
8 // There should be a limited number of chrome.* APIs available to webui. Sanity 8 // There should be a limited number of chrome.* APIs available to webui. Sanity
9 // check them here. 9 // check them here.
10 // 10 //
11 // NOTE: Of course, update this list if/when more APIs are made available. 11 // NOTE: Of course, update this list if/when more APIs are made available.
12 // NOTE2: Apologies to other people putting things on chrome which aren't 12 // NOTE2: Apologies to other people putting things on chrome which aren't
13 // related and whose tests fail. 13 // related and whose tests fail.
14 14
15 var expected = [ 15 var expected = [
16 'csi', 16 'csi',
17 'getVariableValue', 17 'getVariableValue',
18 'loadTimes', 18 'loadTimes',
19 'runtime', 19 'runtime',
20 'send', 20 'send',
21 'test', 21 'test',
22 ]; 22 ];
23 var actual = Object.keys(chrome).sort(); 23 var actual = Object.keys(chrome).sort();
24 24
25 if (!chrome.test.checkDeepEq(expected, actual)) { 25 var isEqual = expected.length == actual.length;
26 for (var i = 0; i < expected.length && isEqual; i++) {
27 if (expected[i] != actual[i])
28 isEqual = false;
29 }
30
31 if (isEqual) {
32 domAutomationController.send(true);
33 } else {
26 console.error('Expected: ' + JSON.stringify(expected) + ', ' + 34 console.error('Expected: ' + JSON.stringify(expected) + ', ' +
27 'Actual: ' + JSON.stringify(actual)); 35 'Actual: ' + JSON.stringify(actual));
28 domAutomationController.send(false); 36 domAutomationController.send(false);
29 } else {
30 domAutomationController.send(true);
31 } 37 }
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/webui/on_message.js ('k') | chrome/test/data/extensions/webui/send_message.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698