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

Side by Side Diff: tools/testing/extensions/chrome/ConsoleCollector/content.js

Issue 11092015: Chrome extension to get console messages upon test failures. Unlike the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // This is the content page script. This runs in the context of the browser
Emily Fortuna 2012/10/09 20:27:24 nit: but in some files you use the /** */ style no
6 // page, and communicates with the background page by relaying a getMessages
7 // request, and the forwarding the messages back to the browser page as a
8 // gotMessages message.
9 window.addEventListener("message", function(event) {
10 if (event.source == window && event.data == "getMessages") {
11 // Log a special sentinel message to mark the end of the messages.
12 console.log('getMessages/end');
13 chrome.extension.sendRequest({command: "getMessages"}, function(messages) {
14 window.postMessage({ "type": "gotMessages", "messages" : messages}, "*");
15 });
16 }
17 }, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698