js/src/gdb/tests/test-prettyprinters.py

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 import mozilla.prettyprinters
     3 run_fragment('prettyprinters.implemented_types')
     5 def implemented_type_names(expr):
     6     v = gdb.parse_and_eval(expr)
     7     it = mozilla.prettyprinters.implemented_types(v.type)
     8     return [str(_) for _ in it]
    10 assert_eq(implemented_type_names('i'), ['int'])
    11 assert_eq(implemented_type_names('a'), ['A', 'int'])
    12 assert_eq(implemented_type_names('b'), ['B', 'A', 'int'])
    13 assert_eq(implemented_type_names('c'), ['C'])
    14 assert_eq(implemented_type_names('c_'), ['C_', 'C'])
    15 assert_eq(implemented_type_names('e'), ['E', 'C', 'D'])
    16 assert_eq(implemented_type_names('e_'), ['E_', 'E', 'C', 'D'])
    17 assert_eq(implemented_type_names('f'), ['F', 'C', 'D'])
    18 assert_eq(implemented_type_names('h'), ['H', 'F', 'G', 'C', 'D'])
    20 # Check that our pretty-printers aren't interfering with printing other types.
    21 assert_pretty('10', '10')
    22 assert_pretty('(void*) 0', '') # Because of 'set print address off'

mercurial