Skip to content

Commit cfb9aea

Browse files
committed
[test] fix race condition in document-start-end
1 parent ca9ba83 commit cfb9aea

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

test/sanity/document-start-end/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ <h1 id='result2'>document event test</h1>
99
var thiswin = nw.Window.get();
1010
var is_top = true;
1111
var start_fired = false;
12+
window.name = "index";
1213
thiswin.on('document-start', function(frame) {
1314
if (frame.is_top || start_fired) return;
1415
document.getElementById('result2').innerHTML = 'start';

test/sanity/document-start-end/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
1212

1313
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
14-
time.sleep(1)
1514
try:
15+
wait_switch_window_name(driver, 'index')
1616
print driver.current_url
1717
result = wait_for_element_id(driver, 'result')
1818
result2 = wait_for_element_id(driver, 'result2')

0 commit comments

Comments
 (0)