forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch contains doc changes and test case. The real fix in on Chromium side. Partial fix for nwjs#4493
- Loading branch information
Cong Liu
committed
Mar 9, 2016
1 parent
f8a6967
commit d715f34
Showing
6 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>issue4493-win-open-size</title> | ||
</head> | ||
<body> | ||
<button id="resize-window" onclick="resizeWindow()">Resize to 777x555</button> | ||
<script> | ||
function out(id, msg) { | ||
var h1 = document.createElement('h1'); | ||
h1.setAttribute('id', id); | ||
h1.innerHTML = msg; | ||
document.body.appendChild(h1); | ||
} | ||
function resizeWindow() { | ||
resizeTo(777,555); | ||
} | ||
window.onresize = function() { | ||
out('resize', innerWidth + 'x' + innerHeight); | ||
}; | ||
out('size', innerWidth + 'x' + innerHeight); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "issue4493-win-open-size", | ||
"main": "index.html", | ||
"window": { | ||
"width": 666, | ||
"height": 333 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import time | ||
import os | ||
import platform | ||
|
||
from selenium import webdriver | ||
from selenium.webdriver.chrome.options import Options | ||
|
||
chrome_options = Options() | ||
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__))) | ||
|
||
# open first time | ||
print 'Open first time' | ||
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options) | ||
driver.implicitly_wait(10) | ||
time.sleep(1) | ||
try: | ||
print driver.current_url | ||
size = driver.find_element_by_id('size').get_attribute('innerHTML') | ||
print 'open size %s' % size | ||
driver.find_element_by_id('resize-window').click() | ||
size = driver.find_element_by_id('resize').get_attribute('innerHTML') | ||
print 'resize to %s' % size | ||
finally: | ||
driver.quit() | ||
|
||
# open second time | ||
print 'Open second time' | ||
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options) | ||
driver.implicitly_wait(10) | ||
time.sleep(1) | ||
try: | ||
print driver.current_url | ||
size = driver.find_element_by_id('size').get_attribute('innerHTML') | ||
print 'open size %s' % size | ||
assert(size == '666x333') | ||
finally: | ||
driver.quit() |