Commit graph

2286 commits

Author SHA1 Message Date
Samuel Attard
9e59d2a78d
spec: fix broken remote specs 2018-09-14 16:57:39 +10:00
Samuel Attard
3487bbe356
spec: handle null prototypes in specs 2018-09-14 16:47:54 +10:00
Samuel Attard
21aa28d60f
refactor: s/resolverGetters/resolveGetters 2018-09-14 16:41:21 +10:00
Samuel Attard
5c8c31c93d
spec: update 'BrowserWindow.fromBrowserView(browserView) returns undefined if not attached - returns undefined if not attached' to match docs (null not undefined) 2018-09-14 16:38:44 +10:00
Samuel Attard
91cc453ccc
spec: add helper to resolve property getters 2018-09-14 16:36:23 +10:00
Samuel Attard
558fff69e7
chore: update to standard 12 2018-09-14 14:57:01 +10:00
Samuel Attard
a55fd16349
fix: update node ref to fix patch handling unhandled rejections (#14603)
Fixes #14573
2018-09-13 16:32:49 +10:00
Robo
d9c6dd0254 chore: add debugger specs for multiple sessions (#14598) 2018-09-13 16:32:30 +10:00
Charles Kerr
a3f7e298cf
refactor: remove unused, duplicated code in deprecate module (#14579)
* remove obsolete tests

 * remove unused deprecate API

 * make a warnOnce helper for the deprecate methods

 * misc. copyediting, e.g. variable names, whitespace

 * test that any deprecation warns once at most

 * use strict
2018-09-12 17:13:22 -05:00
Robo
e860748d6b fix: Invalidate weak ptrs before window Javascript object is destroyed (#14532)
* fix: Invalidate weak ptrs before window Javascript object is destroyed

* chore: add regression test for #14513

This test is similar to the original gist at https://gist.github.com/bpasero/a02a645e11f4946dcca1331d0299149d -- the key is to open multiple windows and add an `app.on('browser-window-focus') listener that accesses window.id.

* fix: last commit didn't test the right thing.

The test needs to run in the main process to reproduce the
conditions reported in #14513
2018-09-12 13:58:04 -05:00
Shelley Vohr
a8a610cb34
chore: remove only on deprecations api spec (#14564)
* chore: remove only

* add option to ignore missing properties
2018-09-11 23:00:41 -07:00
Aleksei Kuzmin
ce8e93bad3 tests: ignore nulls and undefined in the "util.promisify" test 2018-09-11 20:24:04 +02:00
Aleksei Kuzmin
56f5d6f8fa FIXME: tests: disable a "unhandledrejection" test of the remote module 2018-09-11 20:24:04 +02:00
Samuel Attard
dde194d853 Remove the memory property from getAppMetrics
See 03d0bfd593 for more information
2018-09-11 20:24:03 +02:00
Samuel Attard
14df89f214 Remove the 'getProcessMemoryInfo' API
* Underlying APIs have been removed in Chromium
  * https://chromium-review.googlesource.com/c/chromium/src/+/969089
  * https://chromium-review.googlesource.com/c/chromium/src/+/953723
  * https://bugs.chromium.org/p/chromium/issues/detail?id=819289
* https://github.com/electron/electron/projects/11#card-11509601
2018-09-11 20:21:32 +02:00
Robo
14ed71fa1b fix: use render client id to track deleted render process hosts (#14520)
* fix: use render client id to track deleted render process hosts

Instead of relying on OS process id, which may not be unique
when a process is reused, we rely on the renderer client id
passed by the content layer when starting the renderer process
which is guaranteed to be unique for the lifetime of the app.

* fix: store context id as int64_t

Ensuring that it doesn't wrap easily with a large number
of context creation on some malformed web pages.
2018-09-11 11:18:10 -07:00
Shelley Vohr
2157d09956
chore: refactor deprecation apis (#14495) 2018-09-11 11:16:49 -07:00
Milan Burda
38419e3a6a chore: address TODO for WebContents.prototype.setSize / reportRemovedAttribute removal (#14517)
* chore: remove WebContents.prototype.setSize

* chore: remove reportRemovedAttribute

* chore: remove unused fixtures
2018-09-11 17:58:57 +10:00
Milan Burda
58577bd431 feat: add options to webContents.loadFile (#14515) 2018-09-11 17:56:49 +10:00
Milan Burda
dcd580b6cf chore: remove app.makeSingleInstance / releaseSingleInstance (#14518) 2018-09-10 16:33:36 +10:00
Alexey Kuzmin
98eee52fac Revert "fix: re-enable power monitor test (#14458)" (#14506)
This reverts commit 567f8a7583.
2018-09-08 19:37:19 -05:00
Charles Kerr
567f8a7583 fix: re-enable power monitor test (#14458)
* fix: re-enable power monitor test

* update test for correct return type

* fix: mocha 'after' hook of dbus powerMonitor test
2018-09-07 15:23:27 -07:00
Nitish Sakhawalkar
a2ab0d8ebe fix: notify focus change right away rather not on next tick (#14453)
* fix: Notify focus change right away, not on next tick

* fix: emit the JS blur/focus events on next tick to avoid race condition

* address feedback from review

* fix: bind deferred Emit() calls to a WeakPtr

This is so that the deferred Emit() calls will be canceled
if the TopLevelWindow is destroyed.

* chore: remove wip/test code cruft

* fix: make linter happy

* Enable disabled tests

* refactor: cleaner impl of EmitEventSoon()

* Revert "Merge branch 'fix-win-focus' of github.com:electron/electron into fix-win-focus"

This reverts commit 90576806eb271d059f0a215c67e9b4b04f7396a4, reversing
changes made to 9c13e47779a3af78fe0970c1f3d6cd040a5354e6.

* Restore 704722c1, which was removed in error.

We apologise again for the fault in the subtitles. Those responsible for sacking the people who have just been sacked have been sacked.
2018-09-07 13:21:58 -05:00
Alexey Kuzmin
c7bec13069 test: refactor the "util.promisify" test (#14491) 2018-09-07 10:13:10 -05:00
Robo
35a1849e31 chore: enable debugger api specs (#14475) 2018-09-07 00:44:22 +10:00
Robo
8441d09a18 chore: refactor webContents module isCurrentlyAudible api spec (#14410) 2018-09-05 16:00:05 -05:00
Milan Burda
c63014c256 refactor: use loadFile when appropriate in tests (#14422) 2018-09-04 09:50:53 -05:00
Cheng Zhao
10176c71ff
fix: webview.focus() should move page focus to webview (#14427) 2018-09-03 11:41:54 +09:00
Milan Burda
c17a1b37ea feat: add event.senderId property to IPCs sent via ipcRenderer.sendTo (#14395) 2018-08-31 20:13:51 -05:00
Shelley Vohr
dac435b411 test: update power/notification specs to expect (#13497)
* spec: update power/process specs to expect

* Address comments
2018-09-01 08:52:32 +12:00
Robo
32158ca5dd chore: refactor context isolation spec (#14394)
* spec: refactor BrowserWindow module contextIsolation option

* spec: check for serialzation in isolated renderers separately
2018-09-01 08:51:29 +12:00
Milan Burda
3a79eacb6f refactor: don't expose CallbacksRegistry as an internal module (#14389) 2018-08-31 11:29:00 -07:00
Milan Burda
5a0770f1d3 fix: allow Tray with title only (without icon) on Mac (#13851) 2018-08-30 21:16:56 +12:00
Cheng Zhao
459a2304b4 fix: emit focus/blur events for webview (#14344)
* fix: emit focus/blur events for webview

* test: webview can emit focus event
2018-08-28 13:35:44 -05:00
Robo
edd5c4b9bb fix: use OS process handle to clear object registry (#14324)
RenderProcessHost switch can happen between ipc calls when
speculative process are invvolved, which will lead to deletion
of entries on current context. Use OS process handles to
uniquely associate a destruction handler for a render process.
2018-08-28 13:32:46 -05:00
Samuel Attard
68da311ed1 feat: add session.setPermissionCheckHandler (#13925)
* feat: add session.setPermissionCheckHandler to handle syncornous permission checks vs requests

* spec: add tests for session.setPermissionCheckHandler

* docs: add docs for session.setPermissionCheckHandler

* feat: add mediaType to media permission checks

* chore: cleanup check impl
2018-08-28 09:05:08 -05:00
Milan Burda
a08ca9defb fix: don't crash on tray.setContextMenu(null) (#14322) 2018-08-27 11:58:47 -05:00
Aleksei Kuzmin
4943f9fc14 tests: disable "app moduele > app.exit(exitCode) > closes all windows" 2018-08-27 16:21:12 +02:00
Aleksei Kuzmin
1293b463ba tests: refactor "app module" tests 2018-08-26 16:54:51 +03:00
Emmanuel Kimmerlin
5f6706ac33 feat: BrowserWindow.getNormalBounds() (#13290)
* First commit

* Add Mac support (1st attempt)

* Add Mac support (2nd attempt)

* Simplify tests

* Restore window state !

* Looking at other tests, seems minimize, maximize, fullscreen are skipped when in CI

* Fix Mac tests

* Restore tests in CI

* Fix typo

* widget getRestoredBounds not working on Mac !!

* widget getRestoredBounds not working on Mac !!

* Add IsNormal function

* Add IsNormal

* IsNormal => isNormal

* Deactivate fullscreen on Mac. Do not receive leave-fullscreen event

* Set default original_frame_

* Set default original_frame_

* Fix Mac
2018-08-24 14:33:27 -07:00
Jeremy Apthorp
c452be02b9 refactor: properly report on skipped native modules tests (#13894) 2018-08-24 14:24:24 -07:00
Milan Burda
e6e3ccfc50 refactor: use std::string instead of base::string16 for IPC channel names (#14286) 2018-08-24 10:30:37 -05:00
Robo
bce5bd87a8 fix: opt into location services once device service has been started (#14253)
* fix: opt into location services once device service has been started

* refactor: provide fake location provider to mock geolocation reponses

* chore: add spec for navigator.geolocation api using fake location provider
2018-08-23 08:51:46 -07:00
Milan Burda
fc85d02786 feat: expose missing process APIs in sandboxed renderers (#13505) 2018-08-21 11:05:45 -07:00
Troy
5ea05ddee7 fix: Stricter Testing For Menu Items (#13992)
This PR includes stricter testing for empty objects so that false context menus are not created along with the tests to ensure future compatibility.
2018-08-17 13:10:14 -07:00
Cheng Zhao
dd5b8769be fix: use OOPIF for webview tag (#13869)
* fix: use OOIF for webview tag

* fix: do not call GetNativeView for webview

* fix: OOIPF webview's WebContents is managed by embedder frame

* fix: guest view can not be focused

* fix: clear zoom controller when guest is destroyed

* fix: implement the webview resize event

The webview is no longer a browser plugin with the resize event, use
ResizeObserver instead.

* test: disable failed tests due to OOPIF webview

* fix: embedder can be destroyed earlier than guest

This happens when embedder is manually destroyed.

* fix: don't double attach

* fix: recreate iframe when webview is reattached

* fix: resize event may happen very early

* test: some tests are working after OOPIF webview

* chore: remove unused browser plugin webview code

* fix: get embedder via closure

When the "destroyed" event is emitted, the entry in guestInstances would be
cleared.

* chore: rename browserPluginNode to internalElement

* test: make the visibilityState test more robust

* chore: guestinstance can not work with OOPIF webview

* fix: element could be detached before got response from browser
2018-08-16 15:57:40 -07:00
John Kleinschmidt
828e317360 Fix flaky sandbox tests
Windows apparently has issues running opening two windows at once which is causing flakiness on the mixed sandbox tests.
2018-08-13 09:30:20 -07:00
Shelley Vohr
590ae5cd29
fix: re-enable mixed-sandbox tests 2018-08-12 21:29:29 -07:00
Shelley Vohr
b785f45852
fix: override fs.realpathSync.native and fs.realpath.native (#14031)
* fix: override fs.realpathSync.native and fs.realpath.native
* spec: test new native functions
2018-08-12 00:10:55 -07:00
Milan Burda
702cc84bd3 Don't pass preloadPath via ELECTRON_BROWSER_SANDBOX_LOAD for security reasons (#13031) 2018-08-10 17:19:49 -05:00
Husayn
19cb5bad94 feat: Add creationTime function to process (#13542)
* Add process creation time

* Making docs clear for process creation time

* Address comments for process creation time

* Add process info cc file

* fixing comments around documentation

* Update doc for return val

* Capitalize number in docs

* chore: bump electron-typescript-definitions
2018-08-10 09:03:30 -05:00
Shelley Vohr
7c7543cb39 spec: re-enable app.getAppMetric API (#13962) 2018-08-09 13:35:29 -05:00
Milan Burda
9a1ad2b93f fix: ipcRemote.sendSync regression after moving away from JSON for return values (#13941) 2018-08-09 19:45:10 +10:00
Dominic
a7052efaf4 fix: make menu.popup options optional (#13977)
* add empty object as default param for options

* update docs

* add spec for optional options

* fix: add null check for options
2018-08-08 17:38:52 -05:00
Jeremy Apthorp
e6e621515f chore: disable flaky isCurrentlyAudible test (#13970) 2018-08-07 14:23:48 -05:00
Milan Burda
f904057104 fix: add missing "simple" property in several APIs to prevent proxying of return values (#13905)
* fix: add missing "simple" property in several APIs to prevent proxying of return values

* add tests
2018-08-03 12:07:27 -07:00
Jeremy Apthorp
c068bc7d3d test: make nativeImage relative path test robust to different cwd 2018-08-01 15:19:26 -07:00
Jeremy Apthorp
a4f02724bf refactor: use env var to skip native module tests on win32/debug (#13890) 2018-08-01 13:33:13 +10:00
Samuel Attard
4990b3990b
spec: add more assertions to help smoke out the close all window failures (#13868) 2018-08-01 13:32:07 +10:00
Milan Burda
c52b3d921e fix: some APIs modified for ASAR support cannot be util.promisify'ed (#13845) 2018-08-01 13:06:48 +10:00
Jeremy Apthorp
3bdff2d238
feat: allow setting window shape (#13789)
This binds Widget::SetShape, an API that already exists in Chromium (for
Windows and Linux). It's a more reliable method of having some parts of
your window be "click-through" than the current `setIgnoreMouseEvents`
API, which messes around with the `WS_EX_LAYERED` window style on
Windows, causing strange bugs and incompatibility with hardware
acceleration.
2018-07-30 13:37:40 -07:00
Alexey Kuzmin
69f6bd921b chore(tests): allow usage of deprecated APIs in tests (#13659) 2018-07-30 11:27:58 +10:00
Milan Burda
39c5c200ba fix: util.promisify(setTimeout) (#13840) 2018-07-30 11:14:04 +10:00
Milan Burda
db38c8b620 Fix process.execPath returning parent process path instead of the helper in sandboxed renderer (#13839) 2018-07-30 11:13:42 +10:00
Birunthan Mohanathas
a42ca9eecc feat: Add BrowserWindow.setWindowButtonVisibility()
Fixes #12701 and supersedes #13131.

Ideally we would have added `setTitleBarStyle()`, but that is a
significantly more involved change. For example, consider the case where
we switch from `hidden` to `normal`. We would not only have to show the
traffic light buttons, we would also have to switch the window from a
frameless to a framed window and deal with various other window state.
Lets instead implement a simple solution for #12701.
2018-07-25 10:12:27 -07:00
Aleksei Kuzmin
ea16445be7 chore: [tests] update some BrowserWindow tests
- manually close an existing windows before creating a new one.
  We have to do it because the `afterEach` hook doesn't get called
  if a test fails.
- add some async/await goodies
2018-07-24 10:02:54 -07:00
Cheng Zhao
305e3aad40
refactor: remove private webContents.getId() API (#13674) 2018-07-23 18:08:36 +09:00
Cheng Zhao
a88cdf2d1f
spec: suppress mixed-sandbox test in Windows CI (#13769) 2018-07-23 18:08:06 +09:00
Cheng Zhao
9d6f1a372e
fix: create WebContents for webview on request (#13713) 2018-07-21 11:11:28 +09:00
John Kleinschmidt
613b03c3c7 build: disable found-in-page event test
On Windows release builds, the found-in-page event test causes the test suite to hang.  If the test is run individually, it works fine, but running it as part of the whole test suite causes the test suite to hang.  This works around the issue in #13704 by temporarily disabling that test.
2018-07-18 14:59:46 -04:00
Samuel Attard
777d0113d5
fix: create a window capturer correctly (#13689)
* fix: create a window capturer correctly

We were incorrectly creating two screen capturers instead of a window
capturer

* spec: ensure dc tests pass

* spec: enable all tests after verifying dc tests work
2018-07-17 14:20:50 +10:00
Cheng Zhao
222291631d spec: openDevTools should not crash for frameless window 2018-07-16 10:23:43 +09:00
PalmerAL
ffc15e02a6 fix: add native function to create preload script (#13032)
* add native function to create preload script

* add tests

* fix formatting

* fix tests

* rerun CI
2018-07-13 11:17:11 +09:00
John Kleinschmidt
facb210f64
Merge pull request #13494 from electron/expect-short-specs
chore(spec): convert smaller specs to expect
2018-07-12 08:45:34 -04:00
Felix Rieseberg
deedf6c3f4 feat: Add isCurrentlyAudible() to WebContents (#13614)
* 🔧 Add isCurrentlyAudible() to WebContents

* ❤️ Implement feedback, use await to wait for event

* 👷 Add missing imports
2018-07-12 21:35:11 +10:00
Jeremy Apthorp
bdceea6aca fix: enable spell checking, which broke in upgrade to ch66
Chromium commit [03563dd163][1] changed the way that the
spellcheck-enabled status was checked, defaulting to false.

Added the first (!) test for spellchecking, too.

Fixes #13608.

[1]: 03563dd163
2018-07-11 10:27:56 -07:00
Shelley Vohr
d5d76c56ed
address feedback 2018-07-10 14:20:03 -07:00
Tomas Rycl
9b6a37ead7 test: Better path compare than just strings (#13548)
* Better path comparision than just strings

* Linter fix

* Resolving paths first to always obtain absolute path so path.relative() can work

* Using assert.ok which better fits the test

* No need to resolve parameters of path.resolve

* Added assertion to type of returned path for download item
2018-07-10 21:38:11 +10:00
Cheng Zhao
35b867ff7d Fix failed devtools tests due to fs.statSyncNoException not working (#13584)
* Revert "spec: disable the i18nString test"

This reverts commit 86c79653de.

* update node to fix fs.statSyncNoException
2018-07-09 09:38:48 -05:00
Jeremy Apthorp
f50f8e3f3d chore: [gn] fix CSP warning in debugger API test (#13541)
There's an attempt to suppress the warning in `spec/static/main.js`, which
sets `process.env.ELECTRON_DISABLE_SECURITY_WARNINGS`. However, it sets the
variable too late in the boot process: by the time that line in main.js has
run, a child zygote has already been booted. `test.py` works around this by
setting that environment variable outside of the test process, to ensure that
it gets propagated to all children.

I've been running the GN tests directly with `./out/Default/electron
electron/spec`, rather than through the wrapper script, and the
`api-debugger-spec.js` tests were failing, because they depend on a particular
log message being the first one emitted, and the CSP warning was causing that
test to fail, since it wasn't being correctly suppressed.

Instead of writing another wrapper script, this just fixes the underlying thing
that the warning is complaining about, which I think is reasonable because the
test's pass/fail depends on this specific behaviour.
2018-07-06 15:01:33 -04:00
Cheng Zhao
86c79653de spec: disable the i18nString test
It is failed because of fs.statSyncNoException, I'll fix it in another
PR.
2018-07-06 09:07:56 +09:00
Cheng Zhao
56c24406d6 spec: enable back devtools tests 2018-07-06 09:07:56 +09:00
Hari Juturu
eb223f8bc3 Enable webview in sandbox renderer (#13435)
* Enable webview in sandbox renderer
Security: Inherit embedder prefs onto webview

* cache lastwebprefs
2018-07-03 02:06:26 +10:00
Shelley Vohr
42d173b343
spec: convert menu specs to expect (#13485)
* spec: convert menu-item spec to expect

* spec: convert menu spec to expect
2018-06-30 00:25:28 -07:00
Cheng Zhao
e42c6d3eb7
fix the crash when loading site with jquery (#13475) 2018-06-29 09:42:04 +09:00
Shelley Vohr
9489401e7d
spec: convert smaller specs to expect 2018-06-28 15:40:30 -07:00
Shelley Vohr
fa0704665f
test: temporarily disable failing specs (#13470) 2018-06-27 14:15:24 -07:00
Shelley Vohr
f9e2ec43d0
fix: deprecate properties in app.getAppMetrics() (#13446)
* fix: deprecate properties in app.getAppMetrics()

* address feedback from review

* fix deprecated property location

* simplify test
2018-06-26 23:47:01 -07:00
Cheng Zhao
44aad039c6 fix: do not expose Node's external strings (#13438) 2018-06-27 10:18:09 +10:00
Alexey Kuzmin
f4039d82c3 spec: rewrite and enable a webview's disableguestresize attr test (#13428) 2018-06-26 08:38:04 -07:00
Alexey Kuzmin
10a174fc6a spec: refactor helper closeWindow() function (#13337) 2018-06-22 00:43:15 +10:00
Alexey Kuzmin
b9da1575f0 spec: enable a disabled test (#13346) 2018-06-22 00:42:55 +10:00
Felix Rieseberg
562eddf0e9 test: Upgrade spec dependencies (#13310)
* 📦 Update mocha, mocha-junit-reporter

* 📦 Update graceful-fs, multiparty, q, walkdir

* 📦 Update basic-auth

* 📦 Update ws

* 📦 Update dbus-native

* 📦 Upgrade yargs

* 🔒 Run `npm audit fix`

* 🔧 Fix websocket API change
2018-06-20 17:18:24 +10:00
John Kleinschmidt
fc12b5cab3
Merge pull request #13283 from jack-teng1/fix-asar-pack-cant-find-module
fix: can't load module error when app is packaged
2018-06-19 14:58:37 -04:00
Heilig Benedek
f643ce4f66 revert: frame subscriber deprecation and re-enable tests 2018-06-19 19:49:44 +02:00
Jack Teng
3044607746 spec: fix asar spec due to change in node.js
node.js rename the internalModuleReadFile to internalModuleReadJSON
change spec to reflect this change
2018-06-19 10:42:21 -07:00
John Kleinschmidt
36c1e4cd75
Merge pull request #13267 from electron/expect-debugger-spec
spec: convert debugger spec to expect
2018-06-19 11:22:47 -04:00
John Kleinschmidt
faef453df5
Merge branch 'master' into expect-debugger-spec 2018-06-19 11:22:25 -04:00
Shelley Vohr
cba3a9fcce spec: convert deprecations to expect (#13268)
* spec: convert deprecations to expect

* address feedback from review
2018-06-19 10:22:08 -05:00
Shelley Vohr
9a79889692 spec: convert ipc specs to expect (#13273)
* spec: convert ipc specs to expect

* fix buffer value comparison
2018-06-19 10:21:50 -05:00
John Kleinschmidt
0219ef0feb
Merge pull request #13269 from electron/expect-desktop-capturer-spec
spec: convert desktop capturer to expect
2018-06-19 11:21:13 -04:00
Aleksei Kuzmin
5151a04613 spec: slightly rewrite webview tests 2018-06-19 13:27:49 +02:00
Aleksei Kuzmin
bbc8d50799 spec: add helper functions for async/await tests 2018-06-19 13:27:43 +02:00
Samuel Attard
efdf4f44c8 Remove stray .only 2018-06-19 11:49:46 +10:00
Samuel Attard
650631421f re-enable desktop capturer 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
25e5c174f5 Disable a test 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
b70ca6309c Disable a test 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
8f4d6a1995 Rewrite and enable one of the webview tests 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
ad74fb9210 Enable a test 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
da7cfba357 Enable Desktop Capturer tests 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
10c5141da0 Enable a few tests 2018-06-19 11:49:46 +10:00
Samuel Attard
10160b369b FIXME: getAppMetrics fails on windows CI 2018-06-19 11:49:46 +10:00
Samuel Attard
76f26341bf powerMontor crashes linux ia32, re-disable 2018-06-19 11:49:46 +10:00
Samuel Attard
8200a132be Re-enable cookie specs and add custom cookie name/url validation 2018-06-19 11:49:46 +10:00
Samuel Attard
c4f80a6d89 Enable power monitor test for linux 2018-06-19 11:49:46 +10:00
Samuel Attard
10e0d9b198 Enable process resource test 2018-06-19 11:49:46 +10:00
Samuel Attard
e70b93ad91 Enable childprocess.fork asar specs, fixed during run_as_node fixes 2018-06-19 11:49:46 +10:00
Samuel Attard
bc8525d2f3 re-enable native module tests 2018-06-19 11:49:46 +10:00
Samuel Attard
d9ec885dbc Fixed the spawn tests with the RUN_AS_NODE tests 2018-06-19 11:49:46 +10:00
Samuel Attard
f43eafb94e Fixed the fork tests, remove comment 2018-06-19 11:49:46 +10:00
Samuel Attard
de5bdc8be4 Fix inspector tests, you can now have multiple inspector sessions
Refs: https://github.com/nodejs/node/pull/20137
2018-06-19 11:49:46 +10:00
Samuel Attard
9b37e7d988 Re-enable node fork specs 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
0b12e425bd FIXME: Disable powerMonitor tests 2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
03a63a485f FIXME: Disable some of the focus related tests
They all pass localy, so it must be a CI issue.
2018-06-19 11:49:46 +10:00
Aleksei Kuzmin
e96d8b664d Skip one of the "chromium feature" tests 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
1fae6a321c Skip crashReported tests on linux 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
de6a5de914 Disable all failing tests 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
417fe29dc0 Fix the media events test
Playing a media now requires a user gesture.
See https://goo.gl/xX8pDD.
2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
c786abf1e9 Add gfx:PointF support to mate::Converter
It's needed by atom_api_screen, BuildPrototype function on Windows.
2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
7886cfe408 FIXME: Disable "node feature child_process.fork" tests 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
368734b8ab FIXME: Disable "node feature inspector" tests 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
e240a16a20 FIXME: Disable "ses.cookies calls back with an error when setting a cookie with missing required fields" test 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
4a08779bc8 FIXME: Disable a couple of "debugger module debugger.sendCommand" tests 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
3ca288aba4 FIXME: Disable "BrowserWindow module extensions and dev tools extensions works when used with partitions" test 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
6c0b5cd76c FIXME: Disable "BrowserWindow module beginFrameSubscription method" tests 2018-06-19 11:49:45 +10:00
Aleksei Kuzmin
9b9a818c43 FIXME: Disable one of the <webview> tag tests. 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
7e4c0b304b Enable a few tests 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
32ff2ff8fb FIXME: Disable some of <webview> tag tests 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
a45b1a9205 FIXME: Disable a couple of webContents module tests 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
123b35a7f1 FIXME: Disable "asar package child_process.fork" tests 2018-06-19 11:49:44 +10:00
Aleksei Kuzmin
77ae8b65f7 FIXME: Disable desktopCapturer tests 2018-06-19 11:49:44 +10:00
deepak1556
7b47d69efe Remove did-get-response-details and did-get-redirect-request events
https://chromium-review.googlesource.com/c/chromium/src/+/805008
https://chromium-review.googlesource.com/c/chromium/src/+/786320
2018-06-19 11:49:41 +10:00
Zhuo Lu
ab24a1e36d feat: netLog API for dynamic logging control (#13068)
* Introduce `net.{start|stop}Logging()`

- Slight regression right now as Electron won't automatically start logging net-logs at launch, will soon be fixed
- To implement callback for async controls

* Add `net.isLogging` & optional callback param for `net.stopLogging()`

* Fix small regression on --log-net-log

--log-net-log should work again

* Error on empty file path

* Only start with valid file path

* Remove unused var

* Allow setting log file path before URLRequestContextGetter starts logging

* Add net log tests

* Remove redundant checks

* Use brightray::NetLog

* Clean up code

* Should automatically stop listening

* 🎨 Attempt to fix styles

* Only run non-null callback

* Dump file to tmpdir

* Simplify net log spec

Spawned Electron process on Linux CI can fail to launch

* Separate netLog module

* Remove net logging test from net spec

* Add tests for netLog

* Fix header guard

* Clean up code

* Add netLog.currentlyLoggingPath

* Callback with filepath

* Add test for case when only .stopLogging() is called

* Add docs

* Reintroduce error on invalid arg

* Update copyright

* Update error message

* Juggle file path string types
2018-06-19 11:45:58 +10:00
Shelley Vohr
b4cce8e240
spec: convert IAP and GC specs to expect (#13272)
* spec: convert IAP and GC specs to expect

* address review
2018-06-18 09:50:37 -07:00
Shelley Vohr
c65844a7d0
address review feedback 2018-06-18 08:56:24 -07:00
Shelley Vohr
314071d79f
feedback from review 2018-06-18 08:12:54 -07:00
Shelley Vohr
fe94bf7c1d
spec: convert dialog spec to expect (#13271) 2018-06-18 07:56:03 -07:00
Milan Burda
2eb5b751f3 exit HTML fullscreen when window leaves fullscreen (#13090) 2018-06-18 16:48:20 +09:00
Shelley Vohr
2c2e8317de
spec: convert desktop capturer to expect 2018-06-17 16:00:28 -07:00
Shelley Vohr
4dec5ec5f9
spec: update browser-view spec to expect (#13238)
* spec: update browser-view spec to expect
2018-06-17 15:56:04 -07:00
Shelley Vohr
79c2d22c25
remove assert require 2018-06-17 15:37:16 -07:00
Shelley Vohr
8d5fc61c12
spec: update browser-window-affinity spec to expect (#13239)
* spec: update browser-window-affinity spec to expect

* final cleanup
2018-06-17 15:36:30 -07:00
Shelley Vohr
e023035393
spec: convert debugger spec to expect 2018-06-17 15:35:24 -07:00
Shelley Vohr
c5c571f8ec
spec: update callback registry spec to expect (#13263)
* spec: update callback-reg-spec to sexpect

* remove stray only

* remove redundant assertions
2018-06-17 15:08:17 -07:00
Shelley Vohr
0ef0e69f03
spec: convert clipboard spec to use expect (#13266) 2018-06-17 14:47:51 -07:00
Shelley Vohr
a0d252870c
spec: update auto-updater spec to expect (#13237)
* spec: update auto-updater to expect
2018-06-16 00:28:28 -07:00
Shelley Vohr
91559191c9
spec: update app spec to assert (#13155)
* convert app spec from assert to expect and add dirty-chai
2018-06-14 09:44:27 -07:00
Alexey Kuzmin
6a59b37bea spec: better texts for the Crash Reporter tests (#13227)
* Better failure messages for a Crash Reporter test

* Add a TODO
2018-06-14 19:24:28 +10:00
Alexey Kuzmin
dee9aef975 Add "enable_desktop_capturer" build flag (#13133)
* Make it possible to disable a module for a renderer

* Put DesktopCapturer API under a build flag

The name is "enable_desktop_capturer".
Enabled by default.
2018-06-13 11:15:34 -05:00
Thiago de Arruda
6ff111a141 perf: don't use JSON to send the result of ipcRenderer.sendSync. (#8953)
* Don't use JSON to send the result of `ipcRenderer.sendSync`.

- Change the return type of AtomViewHostMsg_Message_Sync from `base::string16`
  to `base::ListValue`
- Adjust lib/browser/api/web-contents.js and /lib/renderer/api/ipc-renderer.js
  to wrap/unwrap return values to/from array, instead of
  serializing/deserializing JSON.

This change can greatly improve `ipcRenderer.sendSync` calls where the return
value contains Buffer instances, because those are converted to Array before
being serialized to JSON(which has no efficient way of representing byte
arrays).

A simple benchmark where remote.require('fs') was used to read a 16mb file got
at least 5x faster, not to mention it used a lot less memory.  This difference
tends increases with larger buffers.

* Don't base64 encode Buffers

* Don't allocate V8ValueConverter on the heap

* Replace hidden global.sandbox with NodeBindings::IsInitialized()

* Refactoring: check NodeBindings::IsInitialized() in V8ValueConverter

* Refactor problematic test to make it more reliable

* Add tests for NaN and Infinity
2018-06-13 17:38:31 +10:00
Milan Burda
6ad0a22602 Add process.getHeapStatistics() (#13183) 2018-06-10 22:00:36 +10:00
Alexey Kuzmin
0d5e98a201 Slightly rewrite <webview> tag tests (#13122) 2018-06-01 10:56:48 +02:00
Charles Kerr
b89fe86fa1
Merge pull request #13050 from electron/3.0.0-deprecations
chore: removal of 3.0.0 deprecations
2018-05-30 09:25:36 +02:00
Shelley Vohr
d40cce92bf
remove deprecated signature tests 2018-05-29 11:42:03 -04:00
Shelley Vohr
2660859434
update signature for setCertificateVerifyProc in session spec 2018-05-29 10:54:27 -04:00
Charles Kerr
2275625e1a feat: warn if deprecated property is already set 2018-05-29 15:58:02 +02:00
Charles Kerr
61fac1bbc1 test: add tests for deprecate.property() 2018-05-29 15:40:48 +02:00
Milan Burda
4cfe5ecaa4 add proper support for typed arrays in remote (#13055) 2018-05-24 21:05:46 +09:00
Aleš Pergl
93bee69266 Remove command line argument black-list (#13039)
* Remove command line argument black-list

Instead block all arguments following a URL.

* Updated tests
2018-05-22 11:51:03 -05:00
Shelley Vohr
560c0e72e6
Fix vulnerabilities both top-level and in spec (#13029)
* fix dependency vulnerabilities

* fix vulnerabilities in spec
2018-05-21 21:15:18 -07:00
Cheng Zhao
300c7a4b04 add tests for View and WebContentsView 2018-05-21 10:53:09 +09:00
Alexey Kuzmin
fc34076c2b Refactor <webview> tag tests (#12886) 2018-05-14 17:00:49 -05:00
Alexey Kuzmin
d5dfb19508 Update some tests (#12917)
* Use Chai for webview tests

* Slightly rewrite one of the <webview> tests

"dom-ready event" > "throws a custom error..."

* Use Chai for BrowserWindow tests

* Rewrite BrowserWindow.addDevToolsExtension tests
2018-05-14 13:17:31 -05:00
Heilig Benedek
eae0674f61 Match chromium's workaround when setting size of unresizable windows 2018-05-12 17:37:31 +02:00
Shelley Vohr
daf75dd375
add app.isPackaged (#12656)
* add isPackaged method

* add false test case for app.isPackaged()

* document add.isPackaged()

* check isPackaged() without fs call

* convert to non-method property

* document app.isPackaged as a property

* update tests for app.isPackaged

* remove unused fs require

* clarify docs for isPackaged()
2018-05-07 23:15:31 -07:00
Samuel Attard
5b5c161601
feat: new makeSingleInstance API (#12782)
* Refactor app.makeSingleInstance
* new API `app.isPrimaryInstance()`
* new API `app.isSingleInstance()`
* new event `app.on('second-instance')`
* deprecated old syntax `app.makeSingleInstance(cb)`
* deprecated old syntax of `app.makeSingleInstance() --> bool` in favor
of `app.isPrimaryInstance()`
* Fix spec, we don't need process.nextTick hacks any more
* Make deprecation TODO for the return value of makeSingleInstance
* Refactor makeSingleInstance to requestSingleInstanceLock and add appropriate deprecation comments
* I swear this isn't tricking the linter
* Make const
* Add deprecation warnings for release, and add to planned-breaking-changes

BREAKING CHANGE
2018-05-08 01:29:18 +10:00
Shelley Vohr
9c8952aef0
Add menu item order control (#12362)
Add four new optional properties to menus in Electron. The four properties are:
'before'
'after'
'beforeGroupContaining'
'afterGroupContaining'

'before/after' - provides a means for a single context menu item to declare its placement relative to another context menu item. These also imply that menu item in question should be placed in the same “group” as the item.

'beforeGroupContaining/afterGroupContaining - provides a means for a single menu item to declare the placement of its containing group, relative to the containing group of the specified item.
2018-05-05 09:37:29 -07:00
Alexey Kuzmin
3fd0ec99ae Better OSR tests (#12817)
* Add features.isOffscreenRenderingEnabled()

* Use .isOffscreenRenderingEnabled() to determine if OSR is available

* Add a helper closeTheWindow() function

* Skip OSR tests if they are disabled
2018-05-03 11:10:25 -05:00
Cheng Zhao
d46aa92f0b
make security-warnings tests more robust (#12757) 2018-05-01 14:28:55 +09:00
Cheng Zhao
e00b128a50
fix flaky security-warnings test (#12749) 2018-05-01 09:49:45 +09:00
Tatsuya Hiroishi
9c65abd746 handle remote exception (#12694)
* add cause property to exception in callFunction

* update exceptionToMeta function

* add sender argument
* and cause property to return value

* update exception convert in metaToValue function

* add from and cause properties to the exception error

* unit test for remote exception
2018-04-24 08:40:19 -04:00
Nitish Sakhawalkar
2579071b98 Deprecate did-get-response-details and did-get-redirect-request (#12615)
* Deprecate webContents events did-get-response-details and did-get-redirect-request.

* Update guest view files

* Update webview tag docs and update specs

* Update deprecate.event function

* Update comment

* Update more

* Update documentation for other deprecated event
2018-04-23 14:46:12 -05:00
Alexey Kuzmin
fcc82ebd35 Add "app.whenReady()" (#12652)
* Make "chai-as-promised" avaialble in tests

* Add "app.whenReady()"

Closes #9561.
2018-04-20 17:09:23 +10:00
Jeremy Apthorp
97fb15ac49 Enable WebFrame method forwarding in sandboxed renderers (#12538)
* Enable WebFrame method forwarding in sandboxed renderers

Fixes #9073

* Non-change to kick CI
2018-04-12 11:57:40 +10:00
Nitish Sakhawalkar
6fc819dae1 Fix transparency in capturePage (#12561)
* Fix transparent window capture. Transparency is preserved and not converted to black pixels anymore

* Add test to make sure aplha channel exists in captured image
2018-04-10 19:07:15 +09:00
Andrew MacDonald
6bfb122cd1 Add a display_id parameter to the desktopCapturer API. (#12417)
* Add a screen_api_id parameter to the desktopCapturer API.

When using the DirectX capturer on Windows, there was previously no way
to associate desktopCapturer/getUserMedia and electron.screen API
screens. This new parameter provides the association.

* Fix non-Windows build.

* Fix Mac.

* Fix Mac harder.

* JS lint

* clang-format C++ code.

* IWYU

* display_id, Linux comment, better test

* lint

* Fix tests on Linux.

* Add display_id documentation.
2018-04-09 14:43:35 +09:00
Nitish Sakhawalkar
970f79e32f Check for devtools in BrowserWindow.getFocusedWindow() (#12526) 2018-04-06 09:21:32 -04:00
Robo
65e8199a93 Enable plznavigate aka browser side navigation (#12535)
* enable plznavigate code path

* AtomBrowserClient::GetGeolocationApiKey returns the right default

* use IsLoadingToDifferentDocument to identify top level navigation in mainFrame

* use candidate site instance when available

* spec: don't test httpReferrer option for file origin

* update libcc ref

* affinity: only group same site in this mode

* plznavigate: don't emit did-get-response-details event for blob scheme
2018-04-06 16:22:52 +09:00
Jeremy Apthorp
f0d08f4da1 Propagate referrer to new windows (#12397)
* Propagate referrer to new windows

Fixes #9205

* Rearrange -new-window event arguments for backwards-compatibility

* Plumb referrer policy through guest-window-manager

* Document the Referrer structure and its uses

* Add tests for referrer in new windows

* Docs nits
2018-04-05 18:13:24 -05:00
Adrien Fery
5486a65702 Improve in-app purchase for MacOS (#12464)
* Add methods to finish transactions

* Add a method to get the product descriptions from the App Store

* Improve the documentation of a transaction structure

* Add a tutorial for In App Purchase

* Fix typo in In-App Purchase tutorial

* Fix style of In-App Purchase files

* Fix In-App-Purchase product structure conversion in amr64

* Fix code style in In-App Purchase tutorial documentation

* Fix typos in In-App Purchase documentation

* Fix typo in In-App Purchase spec

* Slight style fixes
2018-04-05 15:33:13 +09:00
Nitish Sakhawalkar
fbff355742 Support for navigator.languages (#12419) 2018-04-02 12:47:00 +09:00
Cheng Zhao
f41cce96a3 Increase timeout for inAppPurchase test (#12403) 2018-03-22 08:47:29 -05:00
deepak1556
e24c0dda5d add features module to detect availability of build time features at runtime 2018-03-20 10:13:17 +03:00
deepak1556
4b39d17e5f move pdf viewer behind feature flag 2018-03-20 10:13:17 +03:00
deepak1556
f9de29ed8c Enable node crypto spec 2018-03-20 10:13:16 +03:00
Aleksei Kuzmin
d5ecbfc539 spec: Do not assume en-US locale to be the current 2018-03-20 10:13:16 +03:00
Nitish Sakhawalkar
524f56354c Fix webview resize test 2018-03-20 10:13:16 +03:00
deepak1556
80772c2419 FIXME: Disable node crypto spec 2018-03-20 10:13:15 +03:00
deepak1556
719980a948 REVIEW: remove device emulation ipc dependecny on rvh 2018-03-20 10:13:15 +03:00
Aleksei Kuzmin
490b1e2532 FIXME: Disable some tests to avoid crashes 2018-03-20 10:13:15 +03:00