Skip to content

Commit

Permalink
[test] update the case to cover the scenario of bug #5517
Browse files Browse the repository at this point in the history
Also correct some mismatch between design and implementation
  • Loading branch information
xzhan96 authored and rogerwang committed Apr 13, 2017
1 parent e8b611f commit 6cafb8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/sanity/issue4221-win-open-manifest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<a id="linkopen" href="index.html" target="_blank">Open new window with link</a>
<button id="winopen" onclick="winopen()">Open new window</button>
<button id="winopenwithsize" onclick="winopenwithsize()">Open new window with width and height</button>
<button id="bindnewwinpolicy" onclick="bindNewWinPolicy()">Bind new-win-policy to force new window with width 388</button>
<button id="getwinsize" onclick="getwinsize()">Get current window size</button>
<script>
Expand All @@ -20,6 +21,9 @@
function winopen() {
window.open('index.html');
}
function winopenwithsize() {
window.open('index.html', "_blank", "width=600, height=800");
}
function getwinsize() {
out('result', [window.innerWidth, window.innerHeight].join(','));
}
Expand Down
7 changes: 5 additions & 2 deletions test/sanity/issue4221-win-open-manifest/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ def click_and_assert(driver, id, expect):
driver.implicitly_wait(10)
print 'open new window with `window.open()`'
click_and_assert(driver, 'winopen', '400,300')
print 'open new window by `window.open()` with width and height'
print 'newly opended window should have size of 600,800'
click_and_assert(driver, 'winopenwithsize', '600,800')
print 'open new window with <a target="_blank">'
click_and_assert(driver, 'winopen', '400,300')
click_and_assert(driver, 'linkopen', '400,300')
print 'bind new-win-policy and newly opened window should have size of 388,300'
driver.find_element_by_id('bindnewwinpolicy').click()
print 'open new window with `window.open()` after new-win-policy'
click_and_assert(driver, 'winopen', '388,300')
print 'open new window with <a target="_blank"> after new-win-policy'
click_and_assert(driver, 'winopen', '388,300')
click_and_assert(driver, 'linkopen', '388,300')
finally:
driver.quit()

0 comments on commit 6cafb8c

Please sign in to comment.