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.

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

mercurial