Opened 5 years ago

Closed 13 months ago

#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 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by kzar

comment:1 Changed 5 years ago 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 5 years ago by sebastian

  • Priority changed from Unknown to P4
  • Ready set

comment:3 Changed 13 months ago 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.

Note: See TracTickets for help on using tickets.