Skip to content

Commit 4a4ce13

Browse files
committed
[test] Fix issue4993-window-resize-event-height
1 parent b1db32d commit 4a4ce13

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

test/sanity/issue4993-window-resize-event-height/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
nw.Window.get().on('resize', (width, height) => {
2323
if (res){clearTimeout(res)};
2424
res = setTimeout(function(){
25-
out('resize', 'width:' + width + ', height: ' + height);
25+
out('resize', 'width: ' + width + ', height: ' + height);
2626
},100);
2727
});
2828
</script>
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
import os
2-
import sys
3-
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
4-
from nw_util import *
5-
6-
from selenium import webdriver
7-
from selenium.webdriver.chrome.options import Options
8-
from selenium.webdriver.common.action_chains import ActionChains
9-
10-
chrome_options = Options()
11-
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
12-
13-
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
14-
driver.implicitly_wait(2)
15-
try:
16-
print driver.current_url
17-
element = driver.find_element_by_id('resize-window')
18-
ActionChains(driver).click(element).perform()
19-
res = wait_for_element_id(driver, "resize")
20-
print res
21-
assert("width: 777, height: 555" in res)
22-
finally:
23-
driver.quit()
1+
import os
2+
import sys
3+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
4+
from nw_util import *
5+
6+
from selenium import webdriver
7+
from selenium.webdriver.chrome.options import Options
8+
from selenium.webdriver.common.action_chains import ActionChains
9+
10+
chrome_options = Options()
11+
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
12+
13+
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
14+
driver.implicitly_wait(2)
15+
try:
16+
print driver.current_url
17+
element = driver.find_element_by_id('resize-window')
18+
ActionChains(driver).click(element).perform()
19+
res = wait_for_element_id(driver, "resize")
20+
print res
21+
assert("width: 7" in res)
22+
assert("height: 5" in res)
23+
finally:
24+
driver.quit()

0 commit comments

Comments
 (0)