Skip to content

Commit

Permalink
Remove unnecesary token
Browse files Browse the repository at this point in the history
  • Loading branch information
furstenheim-geoblink committed May 19, 2017
1 parent 0d6e611 commit d9b338e
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 23 deletions.
2 changes: 1 addition & 1 deletion extension/background_page/background_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ chrome.runtime.onMessage.addListener(
var queue = new Queue()
var browser = new ChromePopupBrowser({
pageLoadDelay: request.pageLoadDelay
}, {$, window, document})
})

var scraper = new Scraper({
queue: queue,
Expand Down
12 changes: 6 additions & 6 deletions extension/generated/background-scraper.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion extension/scripts/ChromePopupBrowser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var jquery = require('jquery-deferred')
var whenCallSequentially = require('../assets/jquery.whencallsequentially')

var ChromePopupBrowser = function (options, moreOptions) {
var ChromePopupBrowser = function (options) {
this.pageLoadDelay = options.pageLoadDelay

// Not setting window here as it conflicts with this.window. In any case window must be defined in this case
Expand Down
20 changes: 20 additions & 0 deletions extension/scripts/InMemoryStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

var InMemoryStore = function () {
this.data = []
}

InMemoryStore.prototype = {

writeDocs: function (data, callback) {
data.forEach(function (data) {
this.data.push(data)
}.bind(this))
callback()
},

initSitemapDataDb: function (sitemapId, callback) {
callback(this)
}
}

module.exports = InMemoryStore
2 changes: 1 addition & 1 deletion extension/scripts/JSDOMBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var jqueryDeferred = require('jquery-deferred')
const contentScraper = require('../content_script/content_scraper')
var whenCallSequentially = require('../assets/jquery.whencallsequentially')

var JSDOMBrowser = function (options, moreOptions) {
var JSDOMBrowser = function (options) {
this.pageLoadDelay = options.pageLoadDelay
}

Expand Down
2 changes: 1 addition & 1 deletion extension/scripts/JSDOMBrowserLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function (self) {
const data = ev.data
const UUID = data.UUID
if (data.topic === 'init') {
browser = new JSDOMBrowser(data.options, {})
browser = new JSDOMBrowser(data.options)
return self.postMessage({
UUID
})
Expand Down
2 changes: 1 addition & 1 deletion extension/scripts/WebJSDOMBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const jsdomBrowserLoader = require('./JSDOMBrowserLoader')
var jqueryDeferred = require('jquery-deferred')
var whenCallSequentially = require('../assets/jquery.whencallsequentially')

const WebJSDOMBrowser = function (options, moreOptions) {
const WebJSDOMBrowser = function (options) {
this.pageLoadDelay = options.pageLoadDelay
const promises = {}
this.promises = promises
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const runTests = (function () {
if (timeout) clearTimeout(timeout)
timeout = setTimeout(function () {
runKarma(done)
runJSDOMTests()
// runJSDOMTests()
}, 100)
}
})()
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Queue = require('./extension/scripts/Queue')
const Sitemap = require('./extension/scripts/Sitemap')
const FakeStore = require('./tests/FakeStore')
const InMemoryStore = require('./extension/scripts/InMemoryStore')
const Scraper = require('./extension/scripts/Scraper')
const jsdom = require('jsdom')
const jQuery = require('jquery')
Expand All @@ -20,7 +20,7 @@ function scrapeJSDOM (sitemapInfo, options = {}) {
const document = window.document
const $ = jQuery(window)
const q = new Queue()
const store = new FakeStore()
const store = new InMemoryStore()
const sitemap = new Sitemap(sitemapInfo, {$, document, window})
const browser = new Browser({
pageLoadDelay: options.pageLoadDelay || 2000
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = function (config) {
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity,
// browserNoActivityTimeout: 50000000,
browserNoActivityTimeout: 50000000,
plugins: [
'karma-mocha',
'karma-browserify',
Expand Down
8 changes: 4 additions & 4 deletions tests/spec/ScraperSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Scraper', function () {

var browser = new Browser({
pageLoadDelay: 100
}, {$, document, window})
})

var s = new Scraper({
queue: q,
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('Scraper', function () {

var browser = new Browser({
pageLoadDelay: 500
}, {$, document, window})
})

var s = new Scraper({
queue: q,
Expand Down Expand Up @@ -217,7 +217,7 @@ describe('Scraper', function () {

var browser = new Browser({
pageLoadDelay: 500
}, {$, document, window})
})

var sitemap = new Sitemap({
id: 'test'
Expand Down Expand Up @@ -268,7 +268,7 @@ describe('Scraper', function () {

var browser = new Browser({
pageLoadDelay: 500
}, {$, document, window})
})

var s = new Scraper({
queue: q,
Expand Down
6 changes: 3 additions & 3 deletions tests/spec/browser/ChromePopupBrowserSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Chrome popup browser', function () {
it('should init a popup window', function () {
var browser = new ChromePopupBrowser({
pageLoadDelay: 500
}, {$, document, window})
})
browser._initPopupWindow(function () {
})
assert.deepEqual(browser.tab, {id: 0})
Expand All @@ -28,7 +28,7 @@ describe('Chrome popup browser', function () {
it('should load a page', function (done) {
var browser = new ChromePopupBrowser({
pageLoadDelay: 500
}, {$, document, window})
})
browser._initPopupWindow(function () {
})
browser.loadUrl('http://example,com/', function () {
Expand All @@ -51,7 +51,7 @@ describe('Chrome popup browser', function () {

var browser = new ChromePopupBrowser({
pageLoadDelay: 500
}, {$, document, window})
})
browser._initPopupWindow(function () {
})
browser.fetchData('http://example,com/', sitemap, '_root', function (err, data) {
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/browser/ScraperSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Scraper', function () {

var browser = new Browser({
pageLoadDelay: 500
}, {$, document, window})
})

var sitemap = new Sitemap({
id: 'test'
Expand Down

0 comments on commit d9b338e

Please sign in to comment.