Merge pull request #4982 from atom/fix-windows
Fix various problems on Windows build
This commit is contained in:
commit
4b9b630e80
5 changed files with 16 additions and 8 deletions
|
@ -242,7 +242,7 @@ void App::OnCreateWindow(const GURL& target_url,
|
|||
content::WebContents::FromRenderFrameHost(rfh);
|
||||
if (web_contents) {
|
||||
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
|
||||
api_web_contents->CreateWindow(target_url, frame_name, disposition);
|
||||
api_web_contents->OnCreateWindow(target_url, frame_name, disposition);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -316,9 +316,9 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
|
|||
}
|
||||
}
|
||||
|
||||
void WebContents::CreateWindow(const GURL& target_url,
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition) {
|
||||
void WebContents::OnCreateWindow(const GURL& target_url,
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition) {
|
||||
if (type_ == BROWSER_WINDOW)
|
||||
Emit("-new-window", target_url, frame_name, disposition);
|
||||
else
|
||||
|
|
|
@ -139,9 +139,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
bool allowed);
|
||||
|
||||
// Create window with the given disposition.
|
||||
void CreateWindow(const GURL& target_url,
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition);
|
||||
void OnCreateWindow(const GURL& target_url,
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition);
|
||||
|
||||
// Returns the web preferences of current WebContents.
|
||||
v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate);
|
||||
|
|
|
@ -199,7 +199,10 @@ describe('chromium feature', function () {
|
|||
|
||||
it('defines a window.location getter', function (done) {
|
||||
var b, targetURL
|
||||
targetURL = 'file://' + fixtures + '/pages/base-page.html'
|
||||
if (process.platform == 'win32')
|
||||
targetURL = 'file:///' + fixtures.replace(/\\/g, '/') + '/pages/base-page.html'
|
||||
else
|
||||
targetURL = 'file://' + fixtures + '/pages/base-page.html'
|
||||
b = window.open(targetURL)
|
||||
BrowserWindow.fromId(b.guestId).webContents.once('did-finish-load', function () {
|
||||
assert.equal(b.location, targetURL)
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
<meta name="referrer" content="always">
|
||||
<link href="../node_modules/mocha/mocha.css" rel="stylesheet">
|
||||
<script src="jquery-2.0.3.min.js"></script>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
Loading…
Reference in a new issue