Opened 6 years ago

Last modified 5 years ago

#510 closed change

[Typed objects] Don't hardcode script load order in unit tests — at Version 4

Reported by: trev Assignee: trev
Priority: P2 Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: #145 Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/4911523189227520/
http://codereview.adblockplus.org/4895499043733504/

Description (last modified by trev)

Background

Currently the unit tests hardcode the order in which the scripts from the lib/ directory need to load. Every time a new script is created it has to be added to the list in the right position.

What to change

Combine the scripts into a single file (as strings), require() function can then eval them as necessary - this way the "load order" is determined implicitly. Debugging can still be made to work via //#sourceName pragma (sadly broken in stable Firefox releases but working again starting with Firefox 37).

Change History (4)

comment:1 Changed 6 years ago by trev

  • Owner set to trev

comment:2 Changed 6 years ago by trev

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed 6 years ago by trev

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

Unfortunately, this approach was only working in Firefox but not Chrome. So I guess we'll have to live with the hardcoding.

comment:4 Changed 5 years ago by trev

  • Description modified (diff)
  • Platform set to Unknown
  • Resolution rejected deleted
  • Status changed from closed to reopened

Reopening, found a new approach - combine the scripts into a single file (as strings), eval them as necessary. Debugging can still be made to work via //#sourceName pragma (sadly broken in stable Firefox releases but working again starting with Firefox 37).

Note: See TracTickets for help on using tickets.