Opened on 12/11/2015 at 03:58:56 PM

Closed on 07/09/2019 at 07:09:27 PM

#3405 closed defect (rejected)

Multiple unit tests are failing in Adblock Plus for Safari

Reported by: kzar Assignee:
Priority: P4 Milestone:
Module: Platform Keywords: safari, tests
Cc: sebastian Blocked By:
Blocking: Platform: Safari
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):



How to reproduce

  1. Build the extension ./ -t safari devenv
  2. In Safari click Develop, Show Extension Builder and then load the extension.
  3. Open the options page for Adblock Plus Chrome and then type location.href = "qunit/index.html"; in the JavaScript console.

Observed behaviour

Over 50 tests fail, multiple errors in the JavaScript console.

background.js:100 TypeError: undefined is not an object (evaluating 'safari.application.addEventListener')
initadblockplus.js:136 TypeError: undefined is not an object (evaluating '')
webrequest.js:18TypeError: undefined is not an object (evaluating 'require("filterNotifier").FilterNotifier')
adblockplus.js:377 TypeError: undefined is not an object (evaluating 'RegExpFilter.typeMap')
url.js:22 TypeError: undefined is not an object (evaluating 'url.getDecodedHostname')
cssEscaping.js:4 TypeError: undefined is not an object (evaluating 'filterClasses.Filter')

Expected behaviour

Tests should pass.

Attachments (1)

errors.txt (17.6 KB) - added by kzar on 12/11/2015 at 03:59:17 PM.

Download all attachments as: .zip

Change History (4)

Changed on 12/11/2015 at 03:59:17 PM by kzar

comment:1 Changed on 12/12/2015 at 01:09:38 AM by sebastian

Yes, unittests failed ever since on Safari. That is because, as opposed to Chrome, some APIs most importantly a way to communicate with the background page synchronously, are missing on the content side in Safari.

It seems the only way to make tests actually work on Safari, would be to actually run them in the background page, asynchronously reporting the results, and showing them on the page. I couldn't find a way yet to do that with qunit. If there is a simple way to to that, I'd be happy to accept a patch.

comment:2 Changed on 01/20/2016 at 12:33:36 PM by sebastian

  • Priority changed from Unknown to P4
  • Ready set

comment:3 Changed on 07/09/2019 at 07:09:27 PM by sebastian

  • Resolution set to rejected
  • Status changed from new to closed

I'm closing all issues related to the legacy Safari extension, as it has been discontinued in favor of an App Extension that doesn't share any code with the old extension.

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none).
Note: See TracTickets for help on using tickets.