Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / messaging / event_url / test.js
blobf9ef0bb31840997eaf0941a2d2914da45f56bd67
1 // Copyright (c) 2011 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.
5 var messages = [];
7 function messageReceived(data) {
8 messages.push(data);
11 function evaluateMessages() {
12 if (messages.length != 3)
13 chrome.test.notifyFail("Got " + messages.length + " messages instead of 3");
14 else if (messages[0] != "no restriction" ||
15 messages[1] != "http://a.com/" ||
16 messages[2] != "last message")
17 chrome.test.notifyFail("Got wrong messages: " + messages[0] + ", " +
18 messages[1] + ", " + messages[2]);
19 else
20 chrome.test.notifyPass();
24 chrome.test.onMessage.addListener(function (info) {
25 messageReceived(info.data);
26 if (info.lastMessage)
27 evaluateMessages();
28 });