diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index de1272e03e..52d6ec3d33 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -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); } } diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 115926c8a9..8c0f7d571f 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -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 diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index d305172c33..5fb1947f57 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -139,9 +139,9 @@ class WebContents : public mate::TrackableObject, 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 GetWebPreferences(v8::Isolate* isolate); diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index b6e9a775ed..27660156e3 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -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) diff --git a/spec/static/index.html b/spec/static/index.html index e31fcffebb..3c57f94d14 100644 --- a/spec/static/index.html +++ b/spec/static/index.html @@ -3,6 +3,11 @@ +