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

Side by Side Diff: chrome/test/data/extensions/webui/on_message.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 --gtest_filter=ExtensionWebUITest.OnMessage 5 // out/Debug/browser_tests --gtest_filter=ExtensionWebUITest.OnMessage
6 6
7 if (!chrome || !chrome.test || !chrome.test.onMessage) {
8 console.error('chrome.test.onMessage is unavailable on ' +
9 document.location.href);
10 domAutomationController.send(false);
11 return;
12 }
13
7 chrome.test.listenOnce(chrome.test.onMessage, function(args) { 14 chrome.test.listenOnce(chrome.test.onMessage, function(args) {
8 if (args.data != 'hi') { 15 if (args.data != 'hi') {
9 console.error('Expected "hi", Actual ' + JSON.stringify(args.data)); 16 console.error('Expected "hi", Actual ' + JSON.stringify(args.data));
10 chrome.test.sendMessage('false'); 17 chrome.test.sendMessage('false');
11 } else { 18 } else {
12 chrome.test.sendMessage('true'); 19 chrome.test.sendMessage('true');
13 } 20 }
14 }); 21 });
15 22
16 domAutomationController.send(true); 23 domAutomationController.send(true);
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_webui_apitest.cc ('k') | chrome/test/data/extensions/webui/sanity_check_available_apis.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698