Commit graph

52 commits

Author SHA1 Message Date
Milan Burda
1c49e4e376
test: use delay() helper (#24321) 2020-06-26 22:59:54 +02:00
Shelley Vohr
659e79fc08
refactor: prevent consistent early exception (#24191)
* refactor: prevent consistent early exception

* Use _linkedBinding where possible

* Remove dead electronBinding
2020-06-22 20:32:45 -07:00
Robo
7cc780d077
fix: let Node.js perform microtask checkpoint in the main process (#24131)
* fix: let Node.js perform microtask checkpoint in the main process

* fix: don't specify v8::MicrotasksScope for explicit policy

* fix: remove checkpoint from some call-sites

We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.

* fix: remove checkpoint from some call-sites

We already perform checkpoint at the end of a task,
either through MicrotaskRunner or through NodeBindings.
There isn't a need to add them again when calling into JS
except when dealing with promises.

* fix incorrect specs

* default constructor arguments are considered for explicit mark

* add regression spec
2020-06-17 10:08:10 -07:00
Samuel Attard
d3fa5ed1e8
docs: move protocol-ns to protocol.md (#23883)
* docs: move protocol-ns to protocol.md

* chore: fix up tests and implement missing pieces required for tests
2020-06-02 09:46:18 -07:00
Cheng Zhao
5918dd6e65
test: wait for beforeunload handler to be installed (#23874) 2020-06-02 11:32:39 +09:00
Cheng Zhao
08f288faf1
test: use WebContents event to test beforeunload (#23699) 2020-05-26 09:21:38 -04:00
Jeremy Apthorp
8bbb68be79
test: retry beforeunload test (#23576) 2020-05-18 11:04:41 -04:00
Milan Burda
4afc756094
feat: add contents.getBackgroundThrottling() + backgroundThrottling property (#21036) 2020-05-14 15:11:45 +02:00
Milan Burda
fc468cce3b
test: skip remote module related tests when enable_remote_module = false (#23557) 2020-05-13 20:05:44 +02:00
Shelley Vohr
ba3928103f
spec: fix type errors in devToolsWebContents (#23187) 2020-04-20 16:51:27 -07:00
Jeremy Apthorp
2541d62486
chore: remove disable_user_gesture... patch (#23066) 2020-04-16 15:22:39 -07:00
loc
5154e8ff75
fix: enable workaround for nativeWindowOpen hang (#22825) 2020-04-13 11:37:41 -04:00
Samuel Attard
0d2e967960
feat: expose electron/{process} typed modules (#22937)
* feat: expose electron/{process} typed modules

* chore: update imports for common modules

* chore: update typescript generator

* chore: remap electron/* to the internal packages
2020-04-06 17:04:09 -07:00
Samuel Attard
5d657dece4
build: enable JS semicolons (#22783) 2020-03-20 13:28:31 -07:00
Samuel Attard
b87b501161
build: update eslint + eslint plugins (#22777)
* build: run eslint --fix

* chore: manually fix all hasOwnProperty errors

* chore: manually fix all void 0 vs undefined errors

* chore: manually fix all async-in-promise errors

* chore: manually fix lexical declaration in case block
2020-03-20 11:12:18 -04:00
Shelley Vohr
a4c4c86b9d
fix: crash on invalid zoomFactor (#22673) 2020-03-13 16:13:05 -07:00
Shelley Vohr
1b353d1ed3
chore: revert deprecated WebContents properties (#22640)
* chore: revert deprecated WebContents properties

* Fix failing zoomFactor test
2020-03-13 10:16:08 -07:00
Samuel Attard
7b7def7d1e
feat: set app.enableRendererProcessReuse to true by default (#22336)
* feat: set app.enableRendererProcessReuse to true by default

* chore: add context aware info to breaking changes doc

* spec: fix nodeIntegration in child windows test for rendererprocessreuse

* spec: fix remote listeners in destroyed renderers spec as the error is now async

* Update api-browser-window-spec.ts

* chore: deprecate affinity

* chore: fix docs

* spec: handle tests crashing without an exist code

* spec: update tests for new rendererprocessreuse default

* spec: with renderer process re-use we get to destroy less views
2020-02-24 18:11:06 -08:00
John Kleinschmidt
e0c0875d6f
docs: update session.clearAuthCache (#22292)
* docs: update session.clearAuthCache

* Update specs to match doc change.
2020-02-21 13:40:45 -05:00
Shelley Vohr
6ed396df17
fix: crash on custom printing margins (#22164) 2020-02-13 11:15:25 -06:00
Jeremy Apthorp
b77f701aeb
feat: disable the remote module by default (#22091) 2020-02-10 10:49:09 -08:00
Shelley Vohr
928175bdfe
feat: allow specifying pageSize for print (#22014) 2020-02-05 04:25:02 +00:00
Shelley Vohr
2955c67c4e
fix: prevent print crash on bad deviceName (#21946)
* fix: prevent print crash on bad deviceName

* address review feedback
2020-01-31 11:49:13 +09:00
Shelley Vohr
23382e6e08
test: check actual output generated from printToPDF (#21949) 2020-01-30 20:12:35 +00:00
Shelley Vohr
548b290ea7
feat: add more options to printToPDF (#21906) 2020-01-28 20:47:24 +00:00
Shelley Vohr
1e99907acc
fix: printToPDF failing to generate PDF (#21783) 2020-01-15 21:05:36 -08:00
Cheng Zhao
8a92b65fd3 test: retry for a few flaky tests (#21658) 2020-01-09 11:50:30 -08:00
Electron Bot
49b47ee4ed chore: bump chromium to f755b70e34659441e72c1a928a406 (master) (#21000) 2019-12-10 16:22:35 -08:00
Samuel Attard
34452ee69e
feat: expose executeJavaScriptInIsolatedWorld on webContents (#21190)
* feat: expose executeJavaScriptInIsolatedWorld on webContents

* Apply suggestions from code review

Co-Authored-By: loc <andy@slack-corp.com>
2019-11-22 15:33:55 -08:00
Jeremy Apthorp
26ecf63ab4
test: remove a bunch of usage of the remote module (#21119) 2019-11-14 14:09:03 -08:00
Jeremy Apthorp
4f1536479e
fix: implement 'login' event for net.ClientRequest (#21096) 2019-11-14 10:01:18 -08:00
Jeremy Apthorp
034f4d5734
fix: implement 'login' event for WebContents (#20954) 2019-11-11 09:47:01 -08:00
Samuel Attard
24939e8fa4
build: speedy tests on circle by splitting the test files into multiple jobs (#21015)
* build: let circleci divide our test suites in two

* well our tests rely on side affects, thats cool I guess
2019-11-06 16:15:55 -08:00
Jeremy Apthorp
ecd9e1f26e
chore: lint spec-main (#20835) 2019-11-01 13:37:02 -07:00
Milan Burda
bd5a5b3ae6 fix: properly generate requestID in webContents.printToPDF() (#20769) 2019-10-29 11:36:29 +09:00
Cheng Zhao
0fe6767d6b
chore: remove native_mate (Part 11) (#20719)
* refactor: convert Menu and globalShortcut to gin

* refactor: convert api::Cookies to gin

* refactor: convert View and WebContentsView to gin

* refactor: convert WebContents related classes to gin

* refactor: convert powerMonitor to gin

* refactor: prepare for header change

* refactor: remove last uses of mate::EventEmitter

* refactor: remove mate::EventEmitter

* refactor: move trackable_object to gin_helper

* fix: custom converter should not use Handle

* fix: no more need to check if icon is empty

It was a bug that the Handle<NativeImage> can be non-empty when the
image file does not exist. The bug was caused by the converter code
writing out the image even when the convertion fails.

The bug was work-arounded by adding an additional check, but since the
original bug had been fixed, the additional check is no longer needed.

* fix: should always set frameId even when callback is null

* fix: do not mix gin/mate handles for NativeImage
2019-10-25 22:03:28 +09:00
Milan Burda
eb100cdf9e test: skip desktopCapturer / remote module tests when the features are disabled (#20566) 2019-10-14 13:49:21 -07:00
Jeremy Apthorp
2fad53e66b refactor: use v8 serialization for ipc (#20214)
* refactor: use v8 serialization for ipc

* cloning process.env doesn't work

* serialize host objects by enumerating key/values

* new serialization can handle NaN, Infinity, and undefined correctly

* can't allocate v8 objects during GC

* backport microtasks fix

* fix compile

* fix node_stream_loader reentrancy

* update subframe spec to expect undefined instead of null

* write undefined instead of crashing when serializing host objects

* fix webview spec

* fix download spec

* buffers are transformed into uint8arrays

* can't serialize promises

* fix chrome.i18n.getMessage

* fix devtools tests

* fix zoom test

* fix debug build

* fix lint

* update ipcRenderer tests

* fix printToPDF test

* update patch

* remove accidentally re-added remote-side spec

* wip

* don't attempt to serialize host objects

* jump through different hoops to set options.webContents sometimes

* whoops

* fix lint

* clean up error-handling logic

* fix memory leak

* fix lint

* convert host objects using old base::Value serialization

* fix lint more

* fall back to base::Value-based serialization

* remove commented-out code

* add docs to breaking-changes.md

* Update breaking-changes.md

* update ipcRenderer and WebContents docs

* lint

* use named values for format tag

* save a memcpy for ~30% speedup

* get rid of calls to ShallowClone

* extra debugging for paranoia

* d'oh, use the correct named tags

* apparently msstl doesn't like this DCHECK

* funny story about that DCHECK

* disable remote-related functions when enable_remote_module = false

* nits

* use EnableIf to disable remote methods in mojom

* fix include

* review comments
2019-10-09 13:59:08 -04:00
John Kleinschmidt
3f72f07a7f test: remove unneeded console.log (#20424)
(cherry picked from commit 4945a9fce9)
2019-10-06 22:00:38 +02:00
John Kleinschmidt
ad34d7fc32 Revert "test: remove unneeded console.log"
This reverts commit 4945a9fce9.
2019-10-04 11:17:58 -04:00
John Kleinschmidt
4945a9fce9 test: remove unneeded console.log 2019-10-04 11:05:49 -04:00
Milan Burda
2f03d393c3 feat: allow inspection of specific shared workers (#20389) 2019-10-02 14:38:27 +02:00
Jeremy Apthorp
a9e695d05f
test: move more web contents specs (#20099) 2019-09-30 15:00:47 -07:00
Jeremy Apthorp
593f1774e9
fix: backport Node nested microtask fix (#20303) 2019-09-25 17:38:50 -04:00
Jeremy Apthorp
88e32ef231
test: move robotjs-based devtools paste test to main runner (#20095) 2019-09-04 14:44:13 -07:00
John Kleinschmidt
bedc5f7da9
ci: run tests on WOA hardware (#20031)
* ci: run tests on WOA hardware

* Temporarily disable test until #20008 is resolved

* deterministically run tests in sorted order
2019-09-03 13:13:06 -04:00
Jeremy Apthorp
805a55099b test: tsify more web contents specs (#19969)
* test: tsify more WebContents specs

* getFocusedWebContents

* setDevToolsWebContents, isFocused, isCurrentlyAudible

* getWebPreferences, openDevTools

* before-input-event

* zoom-changed

* sendInputEvent

* insertCSS

* startDrag

* focus, getOSProcessId

* zoom api

* more closeAllWindows

* fix detached dev tools test

* fix zoom-changed test

* compare the correct kind of id 🤦‍♂️

* 'fix' openDevTools test to wait for multiple focus events

* fix tests? 🤞

* use request instead of blur to detect openExternal success

* try not timing out the keychain for testing

* use blur event on mac, sigh

* oh, right, still gotta open an actual url
2019-08-29 19:45:41 -05:00
Shelley Vohr
e8fa248571
fix: crash in window.print() (#19690)
* fix: crash in window.print()

* add preliminary tests
2019-08-12 23:44:14 -07:00
Cheng Zhao
04dbd5c53f fix: don't handle browser messages before document element is created (#19718)
* fix: don't handle browser messages before document element is created

* fix: bind ElectronApiServiceImpl later

DidCreateDocumentElement is called before the ElectronApiServiceImpl
gets bound.

* chore: add comment
2019-08-12 10:38:41 -07:00
Jeremy Apthorp
2a5d40617a test: move the last of the browser window specs (#19295)
* move devtools extensions tests

* move executeJavaScript tests

* move previewFile test

* move contextIsolation tests

* move OSR tests

* RIP api-browser-window-spec.js

          .--. .-,       .-..-.__
        .'(`.-` \_.-'-./`  |\_( "\__
     __.>\ ';  _;---,._|   / __/`'--)
    /.--.  : |/' _.--.<|  /  | |
_..-'    `\     /' /`  /_/ _/_/
 >_.-``-. `Y  /' _;---.`|/))))
'` .-''. \|:  .'   __, .-'"`
 .'--._ `-:  \/:  /'  '.\             _|_
     /.'`\ :;   /'      `-           `-|-`
    -`    |     |                      |
          :.; : |                  .-'~^~`-.
          |:    |                .' _     _ `.
          |:.   |                | |_) | |_) |
          :. :  |                | | \ | |   |
          : ;   |                |           |
          : ;   |                | Here lies |
          : ;   |                |   1000    |
          : ;   |                |   flaky   |
          : ;   |                |   tests   |
        .jgs. : ;                |           |
-."-/\\\/:::.    `\."-._'."-"_\\-|           |///."-
" -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-".

* remove unused ipcMain listeners

* remove debugging logs

* close windows in offscreen test

* more closeAllWindows

* remove extra logs

* refactor webContents main spec using closeAllWindows
2019-07-26 10:09:33 -04:00