Skip to content
Permalink
Browse files

test: move some fixtures from spec/ to spec-main/ (#21403)

  • Loading branch information
nornagon committed Jan 9, 2020
1 parent 8a92b65 commit 768a6ace1b2ae1098a60ee704999834ab1216e63
Showing with 27 additions and 32 deletions.
  1. +1 −1 spec-main/api-autoupdater-darwin-spec.ts
  2. +1 −1 spec-main/api-browser-view-spec.ts
  3. +5 −5 spec-main/api-browser-window-spec.ts
  4. +12 −8 spec-main/api-debugger-spec.ts
  5. +1 −1 spec-main/api-ipc-main-spec.ts
  6. +1 −1 spec-main/api-protocol-spec.ts
  7. +1 −1 spec-main/api-web-request-spec.ts
  8. +1 −1 spec-main/chromium-spec.ts
  9. +1 −1 spec-main/content-script-spec.ts
  10. +1 −1 spec-main/extensions-spec.ts
  11. 0 {spec → spec-main}/fixtures/api/ipc-main-listeners/main.js
  12. 0 {spec → spec-main}/fixtures/api/ipc-main-listeners/package.json
  13. 0 {spec → spec-main}/fixtures/api/leak-exit-browserview.js
  14. 0 {spec → spec-main}/fixtures/api/send-sync-message.html
  15. 0 {spec → spec-main}/fixtures/auto-update/check/index.js
  16. 0 {spec → spec-main}/fixtures/auto-update/check/package.json
  17. 0 {spec → spec-main}/fixtures/auto-update/initial/index.js
  18. 0 {spec → spec-main}/fixtures/auto-update/initial/package.json
  19. 0 {spec → spec-main}/fixtures/auto-update/update/index.js
  20. 0 {spec → spec-main}/fixtures/auto-update/update/package.json
  21. 0 {spec → spec-main}/fixtures/devtools-extensions/bad-manifest/manifest.json
  22. 0 {spec → spec-main}/fixtures/devtools-extensions/foo/_locales/en/messages.json
  23. 0 {spec → spec-main}/fixtures/devtools-extensions/foo/foo.html
  24. 0 {spec → spec-main}/fixtures/devtools-extensions/foo/index.html
  25. 0 {spec → spec-main}/fixtures/devtools-extensions/foo/manifest.json
  26. 0 {spec → spec-main}/fixtures/extensions/chrome-api/background.js
  27. 0 {spec → spec-main}/fixtures/extensions/chrome-api/main.js
  28. 0 {spec → spec-main}/fixtures/extensions/chrome-api/manifest.json
  29. 0 {spec → spec-main}/fixtures/extensions/content-script-document-end/end.js
  30. 0 {spec → spec-main}/fixtures/extensions/content-script-document-end/manifest.json
  31. 0 {spec → spec-main}/fixtures/extensions/content-script-document-idle/idle.js
  32. 0 {spec → spec-main}/fixtures/extensions/content-script-document-idle/manifest.json
  33. 0 {spec → spec-main}/fixtures/extensions/content-script-document-start/manifest.json
  34. 0 {spec → spec-main}/fixtures/extensions/content-script-document-start/start.js
  35. 0 {spec → spec-main}/fixtures/extensions/content-script/all_frames-disabled.css
  36. 0 {spec → spec-main}/fixtures/extensions/content-script/all_frames-enabled.css
  37. 0 {spec → spec-main}/fixtures/extensions/content-script/all_frames-preload.js
  38. 0 {spec → spec-main}/fixtures/extensions/content-script/frame-with-frame.html
  39. 0 {spec → spec-main}/fixtures/extensions/content-script/frame.html
  40. 0 {spec → spec-main}/fixtures/extensions/content-script/manifest.json
  41. +1 −1 {spec → spec-main}/fixtures/pages/jquery.html
  42. +1 −1 spec-main/webview-spec.ts
  43. +0 −5 spec/fixtures/crash-app/main.js
  44. +0 −4 spec/fixtures/crash-app/package.json
@@ -9,7 +9,7 @@ import { AddressInfo } from 'net'

const features = process.electronBinding('features')

const fixturesPath = path.resolve(__dirname, '../spec/fixtures')
const fixturesPath = path.resolve(__dirname, 'fixtures')

// We can only test the auto updater on darwin non-component builds
const describeFn = (process.platform === 'darwin' && !process.mas && !features.isComponentBuild() ? describe : describe.skip)
@@ -224,7 +224,7 @@ describe('BrowserView module', () => {

describe('new BrowserView()', () => {
it('does not crash on exit', async () => {
const appPath = path.join(fixtures, 'api', 'leak-exit-browserview.js')
const appPath = path.join(__dirname, 'fixtures', 'api', 'leak-exit-browserview.js')
const electronPath = process.execPath
const appProcess = ChildProcess.spawn(electronPath, [appPath])
const [code] = await emittedOnce(appProcess, 'close')
@@ -3603,7 +3603,7 @@ describe('BrowserWindow module', () => {
})

it('throws errors for invalid manifest.json files', () => {
const badManifestExtensionPath = path.join(fixtures, 'devtools-extensions', 'bad-manifest')
const badManifestExtensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'bad-manifest')
expect(() => {
BrowserWindow.addDevToolsExtension(badManifestExtensionPath)
}).to.throw(/Unexpected token }/)
@@ -3614,7 +3614,7 @@ describe('BrowserWindow module', () => {
const extensionName = 'foo'

before(() => {
const extensionPath = path.join(fixtures, 'devtools-extensions', 'foo')
const extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
BrowserWindow.addDevToolsExtension(extensionPath)
expect(BrowserWindow.getDevToolsExtensions()).to.have.property(extensionName)
})
@@ -3707,7 +3707,7 @@ describe('BrowserWindow module', () => {
}
})

const extensionPath = path.join(fixtures, 'devtools-extensions', 'foo')
const extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
BrowserWindow.addDevToolsExtension(extensionPath)
try {
showLastDevToolsPanel(w)
@@ -3728,7 +3728,7 @@ describe('BrowserWindow module', () => {

it('serializes the registered extensions on quit', () => {
const extensionName = 'foo'
const extensionPath = path.join(fixtures, 'devtools-extensions', extensionName)
const extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', extensionName)
const serializedPath = path.join(app.getPath('userData'), 'DevTools Extensions')

BrowserWindow.addDevToolsExtension(extensionPath)
@@ -3749,7 +3749,7 @@ describe('BrowserWindow module', () => {

it('throws errors for invalid manifest.json files', () => {
expect(() => {
BrowserWindow.addExtension(path.join(fixtures, 'devtools-extensions', 'bad-manifest'))
BrowserWindow.addExtension(path.join(__dirname, 'fixtures', 'devtools-extensions', 'bad-manifest'))
}).to.throw('Unexpected token }')
})
})
@@ -32,7 +32,7 @@ describe('debugger module', () => {
expect(w.webContents.debugger.isAttached()).to.be.true()
done()
})
w.webContents.loadFile(path.join(fixtures, 'pages', 'a.html'))
w.webContents.loadURL('about:blank')
})

it('fails when protocol version is not supported', done => {
@@ -134,7 +134,7 @@ describe('debugger module', () => {
const url = process.platform !== 'win32'
? `file://${path.join(fixtures, 'pages', 'a.html')}`
: `file:///${path.join(fixtures, 'pages', 'a.html').replace(/\\/g, '/')}`
w.webContents.loadFile(path.join(fixtures, 'pages', 'a.html'))
w.webContents.loadURL(url)

try {
w.webContents.debugger.attach()
@@ -144,12 +144,16 @@ describe('debugger module', () => {

w.webContents.debugger.on('message', (e, method, params) => {
if (method === 'Console.messageAdded') {
expect(params.message.level).to.equal('log')
expect(params.message.url).to.equal(url)
expect(params.message.text).to.equal('a')

w.webContents.debugger.detach()
done()
try {
expect(params.message.level).to.equal('log')
expect(params.message.url).to.equal(url)
expect(params.message.text).to.equal('a')
done()
} catch (e) {
done(e)
} finally {
w.webContents.debugger.detach()
}
}
})
w.webContents.debugger.sendCommand('Console.enable')
@@ -6,7 +6,7 @@ import { emittedOnce } from './events-helpers'
import { ipcMain, BrowserWindow } from 'electron'

describe('ipc main module', () => {
const fixtures = path.join(__dirname, '..', 'spec', 'fixtures')
const fixtures = path.join(__dirname, 'fixtures')

afterEach(closeAllWindows)

@@ -82,7 +82,7 @@ describe('protocol module', () => {
// Note that we need to do navigation every time after a protocol is
// registered or unregistered, otherwise the new protocol won't be
// recognized by current page when NetworkService is used.
await contents.loadFile(path.join(fixturesPath, 'pages', 'jquery.html'))
await contents.loadFile(path.join(__dirname, 'fixtures', 'pages', 'jquery.html'))
return contents.executeJavaScript(`ajax("${url}", ${JSON.stringify(options)})`)
}

@@ -5,7 +5,7 @@ import * as path from 'path'
import { session, WebContents, webContents } from 'electron'
import { AddressInfo } from 'net'

const fixturesPath = path.resolve(__dirname, '..', 'spec', 'fixtures')
const fixturesPath = path.resolve(__dirname, 'fixtures')

describe('webRequest module', () => {
const ses = session.defaultSession
@@ -309,7 +309,7 @@ describe('chromium features', () => {
const w = new BrowserWindow({ show: false })
w.webContents.once('did-finish-load', () => { done() })
w.webContents.once('crashed', () => done(new Error('WebContents crashed.')))
w.loadFile(path.join(fixturesPath, 'pages', 'jquery.html'))
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'jquery.html'))
})
})

@@ -7,7 +7,7 @@ import { emittedNTimes } from './events-helpers'
import { BrowserWindow, ipcMain, WebContents } from 'electron'

describe('chrome extension content scripts', () => {
const fixtures = path.resolve(__dirname, '..', 'spec', 'fixtures')
const fixtures = path.resolve(__dirname, 'fixtures')
const extensionPath = path.resolve(fixtures, 'extensions')

const addExtension = (name: string) => BrowserWindow.addExtension(path.resolve(extensionPath, name))
@@ -91,7 +91,7 @@ ifdescribe(process.electronBinding('features').isExtensionsEnabled())('chrome ex
})

ifdescribe(!process.electronBinding('features').isExtensionsEnabled())('chrome extensions', () => {
const fixtures = path.resolve(__dirname, '..', 'spec', 'fixtures')
const fixtures = path.resolve(__dirname, 'fixtures')
let w: BrowserWindow

before(() => {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
<html>
<head>
<script src="../../static/jquery-2.0.3.min.js"></script>
<script src="../../../spec/static/jquery-2.0.3.min.js"></script>
</head>
<body>
<script>
@@ -161,7 +161,7 @@ describe('<webview> tag', function () {
})
BrowserWindow.removeDevToolsExtension('foo')

const extensionPath = path.join(fixtures, 'devtools-extensions', 'foo')
const extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo')
BrowserWindow.addDevToolsExtension(extensionPath)

w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'webview-devtools.html'))

This file was deleted.

This file was deleted.

0 comments on commit 768a6ac

Please sign in to comment.
You can’t perform that action at this time.