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.
7 function messageReceived(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]);
20 chrome
.test
.notifyPass();
24 chrome
.test
.onMessage
.addListener(function (info
) {
25 messageReceived(info
.data
);