Fix Electron deprecations

This commit is contained in:
Wliu
2015-11-17 21:16:09 -05:00
parent 74c0e79986
commit 6cd480b37e
22 changed files with 28 additions and 28 deletions

View File

@@ -47,7 +47,7 @@ describe "AtomEnvironment", ->
describe "window onerror handler", ->
beforeEach ->
spyOn atom, 'openDevTools'
spyOn atom, 'executeJavaScriptInDevTools'
spyOn atom, 'webContents.executeJavaScriptInDevTools'
it "will open the dev tools when an error is triggered", ->
try
@@ -56,7 +56,7 @@ describe "AtomEnvironment", ->
window.onerror.call(window, e.toString(), 'abc', 2, 3, e)
expect(atom.openDevTools).toHaveBeenCalled()
expect(atom.executeJavaScriptInDevTools).toHaveBeenCalled()
expect(atom.webContents.executeJavaScriptInDevTools).toHaveBeenCalled()
describe "::onWillThrowError", ->
willThrowSpy = null
@@ -91,7 +91,7 @@ describe "AtomEnvironment", ->
expect(willThrowSpy).toHaveBeenCalled()
expect(atom.openDevTools).not.toHaveBeenCalled()
expect(atom.executeJavaScriptInDevTools).not.toHaveBeenCalled()
expect(atom.webContents.executeJavaScriptInDevTools).not.toHaveBeenCalled()
describe "::onDidThrowError", ->
didThrowSpy = null

View File

@@ -173,7 +173,7 @@ class AtomReporter
listen document, 'click', '.stack-trace', (event) ->
event.currentTarget.classList.toggle('expanded')
@reloadButton.addEventListener('click', -> require('ipc').send('call-window-method', 'restart'))
@reloadButton.addEventListener('click', -> require('ipc-main').send('call-window-method', 'restart'))
updateSpecCounts: ->
if @skippedCount

View File

@@ -2,7 +2,7 @@ fs = require 'fs'
_ = require 'underscore-plus'
fs = require 'fs-plus'
path = require 'path'
ipc = require 'ipc'
ipc = require 'ipc-main'
module.exports = ({logFile, headless, testPaths, buildAtomEnvironment}) ->
window[key] = value for key, value of require '../vendor/jasmine'

View File

@@ -4585,7 +4585,7 @@ describe('TextEditorComponent', function () {
it('pastes the previously selected text at the clicked location', async function () {
let clipboardWrittenTo = false
spyOn(require('ipc'), 'send').andCallFake(function (eventName, selectedText) {
spyOn(require('ipc-main'), 'send').andCallFake(function (eventName, selectedText) {
if (eventName === 'write-text-to-selection-clipboard') {
require('../src/safe-clipboard').writeText(selectedText, 'selection')
clipboardWrittenTo = true

View File

@@ -4,7 +4,7 @@ fs = require 'fs-plus'
temp = require 'temp'
TextEditor = require '../src/text-editor'
WindowEventHandler = require '../src/window-event-handler'
ipc = require 'ipc'
ipc = require 'ipc-main'
describe "WindowEventHandler", ->
[projectPath, windowEventHandler] = []

View File

@@ -1,4 +1,4 @@
ipc = require 'ipc'
ipc = require 'ipc-main'
path = require 'path'
temp = require('temp').track()