From f7ea7cdb19b1a86ba79870279ba0a9ea9865c0a8 Mon Sep 17 00:00:00 2001 From: ffanny <1402826485@qq.com> Date: Sun, 30 Dec 2018 18:10:33 +0800 Subject: [PATCH] add manual test for nw.Window API --- test/manual/window/index.html | 40 ++++++++++++++++++++++++++++++++++- test/manual/window/popup.html | 13 ++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/test/manual/window/index.html b/test/manual/window/index.html index f2abd95bb2..500b2b34c7 100644 --- a/test/manual/window/index.html +++ b/test/manual/window/index.html @@ -10,6 +10,7 @@ @@ -51,6 +53,11 @@

+ +
+ + +

@@ -63,12 +70,16 @@

+ +



+ +

@@ -84,6 +95,28 @@
+ + + +
+ + +
+ + +
+ +
+ +
+ +
+ +
+ +

Focus another application within 2sec, popup window should on top.

@@ -94,7 +127,12 @@

+ +
Reload the window and do all tests again. +
+
+ diff --git a/test/manual/window/popup.html b/test/manual/window/popup.html index 3e58c9a458..a775c86ad5 100644 --- a/test/manual/window/popup.html +++ b/test/manual/window/popup.html @@ -11,6 +11,17 @@ var enable = false; var gui = require('nw.gui'); var win = gui.Window.get(); + + var menu = new nw.Menu({ type: 'menubar' }); + var submenu = new nw.Menu(); + submenu.append(new nw.MenuItem({ label: 'Item A' })); + submenu.append(new nw.MenuItem({ label: 'Item B' })); + menu.append(new nw.MenuItem({ + label: 'First Menu', + submenu: submenu + })); + win.menu = menu; + win.on('close', function() { if (enable) this.close(true); @@ -72,6 +83,8 @@
+
+