<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
5.0.0 to 8.0.0 beta7
* **Operating System:**
Windows 10

### Expected Behavior
The did-fail-load event should be fired.

### Actual Behavior
The did-fail-load event is not fired.

### To Reproduce
Add an event handler to the did-fail-load event.
Add an event handler to the certificate-error event and cancel the default handling. Then call the callback with false.
The did-fail-load event will not be fired.

```
mainWindow.webContents.on("certificate-error", (event, url, error, certificate, callback) => {
      event.preventDefault();
      callback(false)
});

mainWindow.webContents.on("did-fail-load", (event, url, error, certificate, callback) => {
      console.log("did-fail-load");
});
```

Electron fiddle gist:
https://gist.github.com/c1427e38bf0af9a5e78088fcea6e3c66

### Additional Information
loadURL returns a Promise, in the certificate error case this Promise will be rejected. The gist will show this too.

```
mainWindow.loadURL('https://expired.badssl.com')
  .then(() => console.log("success"))
  .catch(e => console.log("fail"))
```

shell/browser/api/electron_api_app.cc
gin::Arguments* args) {
  v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
  gin_helper::Promise<gfx::Image> promise(isolate);
  v8::Local<v8::Promise> handle = promise.GetHandle();
  base::FilePath normalized_path = path.NormalizePathSeparators();
  IconLoader::IconSize icon_size;
  gin_helper::Dictionary options;
  if (!args->GetNext(&options)) {
    icon_size = IconLoader::IconSize::NORMAL;
  } else {
    std::string icon_size_string;
    options.Get("size", &icon_size_string);
    icon_size = GetIconSizeByString(icon_size_string);
  }
  auto* icon_manager = ElectronBrowserMainParts::Get()->GetIconManager();
  gfx::Image* icon =
      icon_manager->LookupIconFromFilepath(normalized_path, icon_size, 1.0f);
  if (icon) {
    promise.Resolve(*icon);
  } else {
    icon_manager->LoadIcon(
        normalized_path, icon_size, 1.0f,
        base::BindOnce(&OnIconDataAvailable, std::move(promise)),
        &cancelable_task_tracker_);
  }
  return handle;
}
std::vector<gin_helper::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
  std::vector<gin_helper::Dictionary> result;