2013-01-18 18:05:19 +00:00
|
|
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
library sample_test;
|
2014-04-09 19:42:11 +00:00
|
|
|
import 'package:unittest/unittest.dart';
|
|
|
|
import 'package:unittest/html_config.dart';
|
2013-09-24 23:52:16 +00:00
|
|
|
import 'dart:_chrome' as _chrome;
|
2013-01-18 18:05:19 +00:00
|
|
|
|
|
|
|
main() {
|
|
|
|
useHtmlConfiguration();
|
|
|
|
test('access', () {
|
2013-09-24 23:52:16 +00:00
|
|
|
var window = _chrome.app.window;
|
|
|
|
expect(window is _chrome.WindowModule, true);
|
2013-01-18 18:05:19 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('fails from browser', () {
|
|
|
|
// APIs should not work in standard browser apps.
|
|
|
|
expect(() {
|
2014-11-04 15:00:00 +00:00
|
|
|
_chrome.app.window.create('IntentionallyMissingFile.html');
|
2013-01-18 18:05:19 +00:00
|
|
|
}, throws);
|
|
|
|
});
|
|
|
|
}
|