Opened on 05/17/2014 at 09:30:45 PM

Closed on 02/05/2015 at 03:16:27 PM

#510 closed change (fixed)

[Typed objects] Don't hardcode script load order in unit tests

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).

Attachments (0)

Change History (6)

comment:1 Changed on 05/17/2014 at 09:31:04 PM by trev

  • Owner set to trev

comment:2 Changed on 05/17/2014 at 09:32:53 PM by trev

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

comment:3 Changed on 05/19/2014 at 07:38:48 AM 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 on 01/10/2015 at 12:09:00 AM 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).

comment:5 Changed on 01/10/2015 at 12:14:49 AM by trev

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

comment:6 Changed on 02/05/2015 at 03:16:27 PM by trev

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

Add Comment

Modify Ticket

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