e78e8b1cc1
This adds the core skeleton of Chrome application support with a sample function that allows creating a new window (in dart2js). BUG= Review URL: https://codereview.chromium.org//11958026 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17299 260f80e4-7a28-3924-810f-c04153c831b5
24 lines
689 B
Dart
24 lines
689 B
Dart
// 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;
|
|
import '../../pkg/unittest/lib/unittest.dart';
|
|
import '../../pkg/unittest/lib/html_config.dart';
|
|
import 'dart:chrome' as chrome;
|
|
|
|
main() {
|
|
useHtmlConfiguration();
|
|
test('access', () {
|
|
var window = chrome.app.window;
|
|
expect(window is chrome.WindowModule, true);
|
|
});
|
|
|
|
test('fails from browser', () {
|
|
// APIs should not work in standard browser apps.
|
|
expect(() {
|
|
chrome.app.window.create('foo.html');
|
|
}, throws);
|
|
});
|
|
}
|