Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/cast_channel/api/test_open_error.js |
| =================================================================== |
| --- chrome/test/data/extensions/api_test/cast_channel/api/test_open_error.js (revision 0) |
| +++ chrome/test/data/extensions/api_test/cast_channel/api/test_open_error.js (revision 0) |
| @@ -0,0 +1,20 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
|
mark a. foltz
2014/02/24 06:14:05
Please update
Munjal (Google)
2014/02/26 21:30:15
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +var onClose = function(channel) { |
| + assertClosedChannel(channel); |
| +} |
| + |
| +var onError = function(channel) { |
| + chrome.cast.channel.close(channel, onClose); |
| + chrome.test.notifyPass(); |
| +} |
| + |
| +var onOpen = function(channel) { |
|
mark a. foltz
2014/02/24 06:14:05
What order are the onOpen, onError, onClose callba
Munjal (Google)
2014/02/26 21:30:15
onError is called first, then onOpen, then onClose
|
| + assertClosedChannel(channel); |
| + chrome.test.succeed(); |
| +}; |
| + |
| +chrome.cast.channel.onError.addListener(onError); |
| +chrome.cast.channel.open( 'cast://192.168.1.1:8009', onOpen); |
|
mark a. foltz
2014/02/24 06:14:05
extra space
Munjal (Google)
2014/02/26 21:30:15
Done.
|