Skip to content

Commit 74ba410

Browse files
xzhan96rogerwang
authored andcommitted
update the case to cover the scenario of bug nwjs#5517
Also correct some mismatch between design and implementation
1 parent 3adeeb2 commit 74ba410

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

test/sanity/issue4221-win-open-manifest/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<body>
99
<a id="linkopen" href="index.html" target="_blank">Open new window with link</a>
1010
<button id="winopen" onclick="winopen()">Open new window</button>
11+
<button id="winopenwithsize" onclick="winopenwithsize()">Open new window with width and height</button>
1112
<button id="bindnewwinpolicy" onclick="bindNewWinPolicy()">Bind new-win-policy to force new window with width 388</button>
1213
<button id="getwinsize" onclick="getwinsize()">Get current window size</button>
1314
<script>
@@ -20,6 +21,9 @@
2021
function winopen() {
2122
window.open('index.html');
2223
}
24+
function winopenwithsize() {
25+
window.open('index.html', "_blank", "width=600, height=800");
26+
}
2327
function getwinsize() {
2428
out('result', [window.innerWidth, window.innerHeight].join(','));
2529
}

test/sanity/issue4221-win-open-manifest/test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ def click_and_assert(driver, id, expect):
3131
driver.implicitly_wait(10)
3232
print 'open new window with `window.open()`'
3333
click_and_assert(driver, 'winopen', '400,300')
34+
print 'open new window by `window.open()` with width and height'
35+
print 'newly opended window should have size of 600,800'
36+
click_and_assert(driver, 'winopenwithsize', '600,800')
3437
print 'open new window with <a target="_blank">'
35-
click_and_assert(driver, 'winopen', '400,300')
38+
click_and_assert(driver, 'linkopen', '400,300')
3639
print 'bind new-win-policy and newly opened window should have size of 388,300'
3740
driver.find_element_by_id('bindnewwinpolicy').click()
3841
print 'open new window with `window.open()` after new-win-policy'
3942
click_and_assert(driver, 'winopen', '388,300')
4043
print 'open new window with <a target="_blank"> after new-win-policy'
41-
click_and_assert(driver, 'winopen', '388,300')
44+
click_and_assert(driver, 'linkopen', '388,300')
4245
finally:
4346
driver.quit()

0 commit comments

Comments
 (0)