- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / mdns / api / register_multiple_listeners.js
1 // Copyright 2013 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.
4
5 onload = function() {
6   chrome.test.runTests([
7     function registerListeners() {
8       var numEvents = 0;
9       chrome.mdns.onServiceList.addListener(function(services) {
10         if (numEvents++ == 1) {
11           chrome.test.succeed();
12         }
13       }, {'serviceType': '_googlecast._tcp.local'});
14
15       chrome.mdns.onServiceList.addListener(function(services) {
16         if (numEvents++ == 1) {
17           chrome.test.succeed();
18         }
19       }, {'serviceType': '_testing._tcp.local'});
20       chrome.test.notifyPass();
21     }
22   ]);
23 };