Commit graph

2239 commits

Author SHA1 Message Date
Shelley Vohr
72db5ed7cb fix: split out login item tests (#15135) 2018-10-13 18:52:19 +11:00
Shelley Vohr
6fc2a2a051 fix: natively implement LoginItem functions (#15010) 2018-10-12 15:19:27 -07:00
Heilig Benedek
95696c9456 refactor: move text-to-speech out of chromium_src (#15024)
* chore: add tts patch and buildflag, makes tts work again

* chore: add tts patch and buildflag, makes tts work again

* fix: make things compile

* build: add relevant tts files for linux

* fix: update patch and patch description, should now compile on mac

* build: move chrome specific sources under chromium_src:chrome target

* build: enable_extensions again

We are depending on them, check `//electron/chromium_src:chrome` target
for more info.

* fix: update tts.patch to receive notifications about browser context destruction

* fix: extend browser process from chrome layer

The global state g_browser_process is shared between //chrome
and //electron.

* spec: add basic speech synthesis test

* spec: skip speech tests on ci

* build: fix compilation on windows
2018-10-11 08:52:12 -05:00
Alexey Kuzmin
5788600c46 Revert "FIXME: disable isCurrentlyAudible test to unblock merge" (#15078)
This reverts commit c8a9a3f63c.
2018-10-11 08:26:37 -05:00
Milan Burda
5bd6de52e0 feat: add app.enableSandbox() (#14999) 2018-10-10 15:32:09 +11:00
Samuel Attard
2420cdf027 fix: ensure that the window is focused when testing spellchecker 2018-10-10 14:02:46 +11:00
Jeremy Apthorp
c8a9a3f63c FIXME: disable isCurrentlyAudible test to unblock merge 2018-10-09 14:39:39 -07:00
Jeremy Apthorp
edb96c875e FIXME: disable getGPUInfo test to unblock merge
should be fixed and re-enabled before release
2018-10-09 14:39:39 -07:00
deepak1556
3364c04977 FIXME: disable document.visibilityState/hidden <webview> spec 2018-10-09 14:39:39 -07:00
deepak1556
ba14dbe553 FIXME: disable net log spec 2018-10-09 14:39:39 -07:00
deepak1556
7ec05fb202 spec: update media-started-playing tests based on the autoplay policy 2018-10-09 14:39:39 -07:00
Cheng Zhao
7ba287a05e test: make netLog test pass when app crash on exit 2018-10-09 14:38:00 -07:00
Cheng Zhao
a6256c672a feat: getGPUInfo not longer supports 'complete' on macOS
See https://chromium-review.googlesource.com/c/chromium/src/+/1208362
2018-10-09 14:38:00 -07:00
Charles Kerr
05f4860889
fix: power observer dbus crash (#15030)
* fix: check dbus response for nullptr before using

* chore: use BindOnce for ProxyObject::CallMethod cb

* chore: comment out name of unused argument

* fix: re-enable and fix linux power monitor tests

* fix: change tyop from code comments

* refactor: don't keep unnecessary dbus pointer

* chore: remove the 'TODO: fix this' spec comment
2018-10-09 00:32:19 -05:00
Milan Burda
b50f86ef43 refactor: use separate ipc-renderer-internal / ipc-main-internal APIs for Electron internals (#13940) 2018-10-07 00:48:00 +13:00
Robo
6e5dd735f6 refactor: enable weak ptr unwrap sequence dcheck (#14816)
* refactor: enable weak ptr unwrap sequence dcheck

* spec: remove WeakPtrDeathTest.* from disabled list
2018-10-05 15:29:57 -05:00
Charles Kerr
9d4818c784
fix relaunch on linux (#14975)
* chore: re-enable relaunch test for Linux

* fix: relauncher_linux listening for parent exit
2018-10-04 18:41:37 -05:00
Milan Burda
ae8c0f71b1 chore: remove duplicate code in spec/security-warnings-spec.js (#14967) 2018-10-05 00:24:14 +02:00
Robo
434a6e3561 refactor: create request context from network context (#14656)
* [ci skip] refactor: create request context from network context

* [ci skip] refactor: subscribe to mojo cookiemanager for cookie changes

* [ci skip] refactor: manage the lifetime of custom URLRequestJobFactory

* refactor: use OOP mojo proxy resolver

* revert: add support for kIgnoreCertificateErrorsSPKIList

* build: provide service manifest overlays for content services

* chore: gn format

* fix: log-net-log switch not working as expected

* spec: verify proxy settings are respected from pac script with session.setProxy

* chore: use chrome constants where possible

* fix: initialize request context for global cert fetcher

* refactor: fix destruction of request context getters

* spec: use custom session for proxy tests

* fix: queue up additional stop callbacks while net log is being stopped

* fix: Add CHECK for cookie manager retrieval

* chore: add helper to retrieve logging state for net log module

* fix: ui::ResourceBundle::GetRawDataResourceForScale => GetRawDataResource

* style: comment unused parameters

* build: move //components/certificate_transparency deps from //brightray

* chore: update gritsettings_resource_ids patch

* chore: update api for chromium 68

* fix: net log instance is now a property of session
2018-10-04 13:08:56 -05:00
John Kleinschmidt
038b56e31e
ci: Trigger an arm test on VSTS after CircleCI build (#14898)
* ci: Trigger an arm test on VSTS after CircleCI build
2018-10-04 12:01:16 -04:00
Alexey Kuzmin
f161835fc3 test: disable one test in base_unittests (#14968)
Fails after the Chromium 68 upgrade.
2018-10-04 10:00:30 -04:00
Aleksei Kuzmin
21f382fcae test: disable the "app.relaunch" test on Linux 2018-10-04 00:21:58 +02:00
Jeremy Apthorp
45c2dcddb0 disable failing assert in beginFrameSubscription dirty-rectangle test 2018-10-04 00:15:00 +02:00
Samuel Attard
0ee46cdc26 test: make run-as-node --inspect test more robust on windows 2018-10-04 00:14:59 +02:00
Cheng Zhao
b11b4f2235 test: make before-input-event test more robust 2018-10-04 00:14:59 +02:00
Jeremy Apthorp
09f018ce8c test: fix frame-subscriber test on Mac 2018-10-04 00:14:59 +02:00
Jeremy Apthorp
cc53269231 better crash diagnostics in ffmpeg test 2018-10-04 00:14:59 +02:00
Aleksei Kuzmin
ae95f77d68 test: minor improvements to the Node spec
- reformat some parts
 - better failures reporting with `expect`
 - skip some tests instead of marking them as passed
2018-10-04 00:14:59 +02:00
Milan Burda
5efb0fdff1 feat: add security warnings to sandboxed renderers (#14869)
Also refactor not to use the remote module.
2018-10-03 21:36:12 +02:00
Cheng Zhao
4c4d8c5bfa fix: support ASAR in fs.copyFile (#14942) 2018-10-03 09:36:20 -07:00
Milan Burda
3ad3ade828 refactor: add prefer-const to .eslintrc + fix errors (#14880) 2018-10-02 11:56:31 +10:00
Alexey Kuzmin
c9edf77e8e test: slightly rewrite getGPUInfo() tests (#14863)
Rewrite GPUInfo tests for linux and update `getGPUInfo` functionality for linux.
`basic` and `complete` GPUInfo is same for linux.
2018-10-01 18:34:52 -07:00
Alexey Kuzmin
f1b097024e ci: run more unittests (#14861) 2018-10-01 17:50:52 -05:00
Alexey Kuzmin
60ac03c08f test: disable getGPUInfo() tests on Linux (#14875) 2018-10-01 12:57:38 +10:00
Milan Burda
d48f9bcf7f refactor: implement <webview> methods via dedicated IPCs without the remote module (#14377) 2018-10-01 10:07:50 +09:00
Milan Burda
c61db523c7 refactor: replace var with const / let (#14866) 2018-09-29 09:17:00 +10:00
Samuel Attard
b42493e6e6 test: guarantee the order of webview and devtools creation (#14849) 2018-09-28 12:34:57 -07:00
Samuel Attard
2adb44a402 chore: remove unused files to simply out_dir replacements 2018-09-28 11:16:37 +10:00
Samuel Attard
6be69048e6
fix: handle shortcuts by default if no WebPreferences object exists (#14766)
DevTools webcontents do not have webpreferences

Fixes #14685
2018-09-28 01:41:09 +10:00
Nitish Sakhawalkar
5c108728d6 feat: Implementation of getGPUInfo API. (#13486)
* Implementation of getGPUInfo API.

* Clear promise set

* Changes to promise usage

* Minor fixes

* Fix linux build

* Update spec

* Fix lint (linter didn't run on windows locally)

* Test running single test for CI

* Update spec
2018-09-28 00:59:23 +10:00
Samuel Attard
7dc7cd1d89
fix: send null in debugger callback when no error (#14814)
Fixes #13811
2018-09-27 17:43:45 +10:00
Milan Burda
3df739fa89 refactor: implement crashReporter.start() without the remote module (#14434) 2018-09-26 15:43:34 +10:00
Troy
560b1c17af fix: setMaximizable to be true if window is resizable & maximizable (#14648)
* setMaximizable to be true if window is resizable & maximizable

* Fix linting

* Add regressive test to verify maxmizable state

* Leaves maximizable state of window alone if setResizable is called

* Fix exclusive test

* Fix crashing text

* SetMaximizable unconditionally

* Remember former maximizable state

* Fix accidental mac variable deletion

* Logic modification

* Lint

* Remove unneeded test

* Remove unneeded variable since only Windows is effect
2018-09-26 11:41:40 +10:00
Samuel Attard
50a4a8e9c3
spec: add test for syncronous access to blink APIs (#14637)
This test should ensure we catch a regression of #13787
2018-09-25 10:40:15 +12:00
John Kleinschmidt
8854d9872c test: reenable app moduele > app.exit(exitCode) > closes all windows 2018-09-20 09:32:02 -04:00
Jeremy Apthorp
73d1b76b54
test: runas is not an optional dependency (#14704) 2018-09-19 15:59:37 -07:00
Milan Burda
e22142ef9c feat: add process.takeHeapSnapshot() / webContents.takeHeapSnapshot() (#14456) 2018-09-18 11:00:31 -07:00
Samuel Attard
6d01952e66
chore: replace standard with eslint-config-standard and add custom rules (#14636)
* chore: replace standard with eslint-config-standard

This adds support for --cache so linting JS only takes ~1 second and only lints things that changed

It also allows us to add custom linting rules

* chore: add eslint-plugin-mocha and enable the no-exclusive-tests rule

This will block anyone from pushing / merging a `.only` test or describe
2018-09-16 03:51:23 +10:00
Samuel Attard
7065093869
feat: add will-redirect (#13866)
* feat: add will-redirect to allow people to prevent 30X redirects

* spec: add tests for the will-redirect event

* refactor: implement will-redirect using NavigationThrottle instead of PostTask

This avoids a potential race condition and immediately cancels the
navigation

* docs: add docs for did-redirect-navigation

* refactor: move AtomNavigationThrottle out of net folder

* refactor: update header guard for atom_navigation_throttle.h

* refactor: fix chromium style errors in the GN build

* refactor: update throttle impl to NOTREACHED and std::make_unqique
2018-09-16 01:42:43 +10:00
John Kleinschmidt
838b26ee26 ci: Move Mac builds to Azure Devops (VSTS) (#14588)
* Add support for multiple mocha reporters

Allows us to output to junit file and to console at the same time

* Cleanup VSTS file

Don't install depot_tools everytime as it is already installed.

Only run tests if "RUN_TESTS" environment variable is set
Only notify slack if "NOTIFY_SLACK" environment variable is set

Don't use sccache for release builds

Move CircleCI mac builds to VSTS

* Only build mac PRS from forks

Don't install depot_tools everytime as it is already installed.

Only run tests if "RUN_TESTS" environment variable is set
Only notify slack if "NOTIFY_SLACK" environment variable is set

Don't use sccache for release builds

Move CircleCI mac builds to VSTS

Use sccache helper script

* rename vsts-gn.yml to vsts.yml
Make sure Electron isn't running before starting tests
2018-09-14 11:56:16 -07:00
Samuel Attard
dc2a6c5d71
spec: fix crashReporter upload assertions 2018-09-14 22:23:58 +10:00
Samuel Attard
40f0f049a2
spec: fix final node and chromium specs after assert change 2018-09-14 18:32:17 +10:00
Samuel Attard
4bcc08826b
spec: fix headers tests to match APIs 2018-09-14 17:05:26 +10:00
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