WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
86931
LayoutTests: fast/js/resources/js-test-pre.js - shouldBeEqualToString fails on "
https://bugs.webkit.org/show_bug.cgi?id=86931
Summary
LayoutTests: fast/js/resources/js-test-pre.js - shouldBeEqualToString fails on "
Joshua Bell
Reported
2012-05-18 18:02:55 PDT
function shouldBeEqualToString(a, b) { var unevaledString = '"' + b.replace(/\\/g, "\\\\").replace(/"/g, "\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"'; shouldBe(a, unevaledString); } That replace(/"/g, "\"") should be replace(/"/g, "\\"") Or just replace that whole line with: var unevaledString = JSON.stringify(b);
Attachments
Patch
(14.66 KB, patch)
2012-05-21 10:52 PDT
,
Joshua Bell
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ec2-cr-linux-04
(552.91 KB, application/zip)
2012-05-21 11:41 PDT
,
WebKit Review Bot
no flags
Details
Patch for landing
(20.56 KB, patch)
2012-05-21 11:50 PDT
,
Joshua Bell
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Joshua Bell
Comment 1
2012-05-21 10:52:37 PDT
Created
attachment 143058
[details]
Patch
Joshua Bell
Comment 2
2012-05-21 10:56:33 PDT
I'm expecting a handful of tests to 'asplode as a result of this change - anything that was relying on the broken escaping behavior of shouldBeEqualToString. Let's see what the bots say. Alec, can you sanity check the IDB test change?
Ojan Vafai
Comment 3
2012-05-21 11:14:39 PDT
Comment on
attachment 143058
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=143058&action=review
> LayoutTests/fast/js/resources/js-test-pre.js:261 > + var unevaledString = JSON.stringify(b);
On the one hand, this is simpler, on the other it means that if you're explicitly testing that you get a string and not and object that stringifies to the same thing, then this won't work. Can we add a typeof b == 'string' check?
Alec Flett
Comment 4
2012-05-21 11:26:05 PDT
Glad to see this go in, I struggled to get this right and it drove me nuts - LGTM (agree on the typeof comment from ojan as well)
Joshua Bell
Comment 5
2012-05-21 11:40:22 PDT
(In reply to
comment #3
)
> On the one hand, this is simpler, on the other it means that if you're explicitly testing that you get a string and not and object that stringifies to the same thing, then this won't work. > > Can we add a typeof b == 'string' check?
Agreed and will do. Shouldn't break anything either, as b.replace() was previously called without a String() coercion.
WebKit Review Bot
Comment 6
2012-05-21 11:41:49 PDT
Comment on
attachment 143058
[details]
Patch
Attachment 143058
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/12749018
New failing tests: storage/domstorage/complex-values.html fast/dom/HTMLElement/class-list.html fast/dom/HTMLElement/class-list-quirks.html fast/dom/HTMLOutputElement/dom-settable-token-list.html
WebKit Review Bot
Comment 7
2012-05-21 11:41:52 PDT
Created
attachment 143068
[details]
Archive of layout-test-results from ec2-cr-linux-04 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-04 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Joshua Bell
Comment 8
2012-05-21 11:47:37 PDT
As expected... (In reply to
comment #6
)
> New failing tests: > storage/domstorage/complex-values.html
PASS->PASS, but output differs: contains an embedded NUL, was printed as \0 now printed as \u0000
> fast/dom/HTMLElement/class-list.html
PASS->PASS, but output differs: contains an embedded TAB, was printed as tab character, now printed as \t
> fast/dom/HTMLElement/class-list-quirks.html
PASS->PASS, but output differs: contains an embedded TAB, was printed as tab character, now printed as \t
> fast/dom/HTMLOutputElement/dom-settable-token-list.html
PASS->PASS, but output differs: contains an embedded TAB, was printed as tab character, now printed as \t Will rebase these tests.
Joshua Bell
Comment 9
2012-05-21 11:50:25 PDT
Created
attachment 143069
[details]
Patch for landing
WebKit Review Bot
Comment 10
2012-05-21 12:19:29 PDT
Comment on
attachment 143069
[details]
Patch for landing Clearing flags on attachment: 143069 Committed
r117806
: <
http://trac.webkit.org/changeset/117806
>
WebKit Review Bot
Comment 11
2012-05-21 12:19:34 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug