add DidFailProvisionalLoad method
This commit is contained in:
parent
bb2f3a82d9
commit
87cb2ece80
3 changed files with 18 additions and 0 deletions
|
@ -197,6 +197,15 @@ void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
|
||||||
Emit("did-finish-load");
|
Emit("did-finish-load");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this error occurs when host could not be found
|
||||||
|
void WebContents::DidFailProvisionalLoad(
|
||||||
|
content::RenderFrameHost* render_frame_host,
|
||||||
|
const GURL& validated_url,
|
||||||
|
int error_code,
|
||||||
|
const base::string16& error_description) {
|
||||||
|
Emit("did-fail-load", error_code, error_description);
|
||||||
|
}
|
||||||
|
|
||||||
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
|
|
|
@ -154,6 +154,10 @@ class WebContents : public mate::EventEmitter,
|
||||||
const GURL& validated_url,
|
const GURL& validated_url,
|
||||||
int error_code,
|
int error_code,
|
||||||
const base::string16& error_description) override;
|
const base::string16& error_description) override;
|
||||||
|
void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host,
|
||||||
|
const GURL& validated_url,
|
||||||
|
int error_code,
|
||||||
|
const base::string16& error_description) override;
|
||||||
void DidStartLoading(content::RenderViewHost* render_view_host) override;
|
void DidStartLoading(content::RenderViewHost* render_view_host) override;
|
||||||
void DidStopLoading(content::RenderViewHost* render_view_host) override;
|
void DidStopLoading(content::RenderViewHost* render_view_host) override;
|
||||||
void DidGetRedirectForResourceRequest(
|
void DidGetRedirectForResourceRequest(
|
||||||
|
|
|
@ -58,6 +58,11 @@ describe 'browser-window module', ->
|
||||||
done()
|
done()
|
||||||
w.loadUrl 'about:blank'
|
w.loadUrl 'about:blank'
|
||||||
|
|
||||||
|
it 'should emit did-fail-load event', (done) ->
|
||||||
|
w.webContents.on 'did-fail-load', ->
|
||||||
|
done()
|
||||||
|
w.loadUrl 'file://a.txt'
|
||||||
|
|
||||||
describe 'BrowserWindow.show()', ->
|
describe 'BrowserWindow.show()', ->
|
||||||
it 'should focus on window', ->
|
it 'should focus on window', ->
|
||||||
return if isCI
|
return if isCI
|
||||||
|
|
Loading…
Reference in a new issue