[simple_browser] target test stub
Change-Id: Ia7d541fdc5bd91b43ccc0e735ddf0787b26e6eec
diff --git a/BUILD.gn b/BUILD.gn
index 601504d..e116d8e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -18,10 +18,19 @@
testonly = true
public_deps = [
+ ":dart_target_tests",
":dart_unittests",
]
}
+# Dart tests which can run on target
+group("dart_target_tests") {
+ testonly = true
+ public_deps = [
+ "bin:dart_target_tests",
+ ]
+}
+
# Dart unit tests which can run on the host or target
group("dart_unittests") {
testonly = true
diff --git a/bin/BUILD.gn b/bin/BUILD.gn
index 4e0a319..b7819db 100644
--- a/bin/BUILD.gn
+++ b/bin/BUILD.gn
@@ -8,6 +8,14 @@
]
}
+group("dart_target_tests") {
+ testonly = true
+
+ deps = [
+ "simple_browser:simple_browser_target_test",
+ ]
+}
+
group("dart_unittests") {
testonly = true
diff --git a/bin/simple_browser/BUILD.gn b/bin/simple_browser/BUILD.gn
index 26abc9e..4030bd7 100644
--- a/bin/simple_browser/BUILD.gn
+++ b/bin/simple_browser/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/testing/environments.gni")
+import("//topaz/runtime/dart/dart_fuchsia_test.gni")
import("//topaz/runtime/dart/flutter_test.gni")
import("//topaz/runtime/flutter_runner/flutter_app.gni")
@@ -36,6 +38,7 @@
]
}
+# fx run-host-tests simple_browser_unittests
flutter_test("simple_browser_unittests") {
sources = [
"simple_browser_test.dart",
@@ -49,3 +52,25 @@
"//third_party/dart-pkg/pub/test",
]
}
+
+# fx run-test simple_browser_target_test
+dart_fuchsia_test("simple_browser_target_test") {
+ meta = [
+ {
+ path = rebase_path("meta/simple_browser_target_test.cmx")
+ dest = "simple_browser_target_test.cmx"
+ },
+ ]
+
+ sources = [
+ "simple_browser_target_test.dart",
+ ]
+
+ deps = [
+ ":simple_browser_dart_library",
+ "//third_party/dart-pkg/git/flutter/packages/flutter_test",
+ "//third_party/dart-pkg/pub/test",
+ ]
+
+ environments = basic_envs
+}
diff --git a/bin/simple_browser/meta/simple_browser_target_test.cmx b/bin/simple_browser/meta/simple_browser_target_test.cmx
new file mode 100644
index 0000000..6aa4668
--- /dev/null
+++ b/bin/simple_browser/meta/simple_browser_target_test.cmx
@@ -0,0 +1,31 @@
+{
+ "program": {
+ "data": "data/simple_browser_target_test"
+ },
+ "sandbox": {
+ "services": [
+ "fuchsia.cobalt.LoggerFactory",
+ "fuchsia.deprecatedtimezone.Timezone",
+ "fuchsia.fonts.Provider",
+ "fuchsia.logger.LogSink",
+ "fuchsia.media.Audio",
+ "fuchsia.mediacodec.CodecFactory",
+ "fuchsia.modular.Clipboard",
+ "fuchsia.modular.ModuleContext",
+ "fuchsia.posix.socket.Provider",
+ "fuchsia.net.NameLookup",
+ "fuchsia.netstack.Netstack",
+ "fuchsia.process.Launcher",
+ "fuchsia.sys.Environment",
+ "fuchsia.sys.Launcher",
+ "fuchsia.sysmem.Allocator",
+ "fuchsia.ui.input.ImeService",
+ "fuchsia.ui.input.ImeVisibilityService",
+ "fuchsia.ui.scenic.Scenic",
+ "fuchsia.ui.policy.Presenter",
+ "fuchsia.modular.ComponentContext",
+ "fuchsia.vulkan.loader.Loader",
+ "fuchsia.web.ContextProvider"
+ ]
+ }
+}
diff --git a/bin/simple_browser/test/simple_browser_target_test.dart b/bin/simple_browser/test/simple_browser_target_test.dart
new file mode 100644
index 0000000..ef76b9a
--- /dev/null
+++ b/bin/simple_browser/test/simple_browser_target_test.dart
@@ -0,0 +1,11 @@
+// Copyright 2019 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'package:test/test.dart';
+
+void main() {
+ test('test stub', () {
+ expect(true, true);
+ });
+}
diff --git a/bin/simple_browser/test/simple_browser_test.dart b/bin/simple_browser/test/simple_browser_test.dart
index 7083480..6f19acc 100644
--- a/bin/simple_browser/test/simple_browser_test.dart
+++ b/bin/simple_browser/test/simple_browser_test.dart
@@ -13,7 +13,10 @@
void main() {
// Add a tab, and see that there is 1 tab
test('add 1 tab', () async {
- final tb = TabsBloc(tabFactory: () => 'a', disposeTab: (tab) => tab.dispose());
+ final tb = TabsBloc(
+ tabFactory: () => 'a',
+ disposeTab: (tab) => tab.dispose(),
+ );
await _newTab(tb);
expect(tb.tabs.length, 1, reason: "doesn't have 1 tab");
@@ -22,7 +25,10 @@
// Add 2 tabs, see that there are 2 tabs and that focus is on the second
test('add 2 tabs', () async {
TabsBloc tb;
- tb = TabsBloc(tabFactory: () => 'tab ${tb.tabs.length}', disposeTab: (tab) => tab.dispose());
+ tb = TabsBloc(
+ tabFactory: () => 'tab ${tb.tabs.length}',
+ disposeTab: (tab) => tab.dispose(),
+ );
await _newTab(tb);
await _newTab(tb);
@@ -37,7 +43,10 @@
// Add 2 tabs, focs on the first, see that the focus is on the first, and its value one is correct
test('add 2 tabs and focus on first tab', () async {
TabsBloc tb;
- tb = TabsBloc(tabFactory: () => 'tab ${tb.tabs.length}', disposeTab: (tab) => tab.dispose());
+ tb = TabsBloc(
+ tabFactory: () => 'tab ${tb.tabs.length}',
+ disposeTab: (tab) => tab.dispose(),
+ );
await _newTab(tb);
await _newTab(tb);
await _focusTab(tb, tb.tabs.first);