mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
JavaScript Test - bug 357352 - e4x/Namespace/regress-350442.js is too strict and requires a particular implementation-dependent generated prefix. r=inonit@inonit.com as agreement that this fix is implementation-independent, assuming the tested implementation doesn't violate the spec in extremely weird ways.
This commit is contained in:
parent
3ef9f3a548
commit
239ae04168
@ -38,18 +38,34 @@
|
|||||||
|
|
||||||
var bug = 350442;
|
var bug = 350442;
|
||||||
var summary = 'toXMLString with namespace definitions';
|
var summary = 'toXMLString with namespace definitions';
|
||||||
var actual = '';
|
var actual, expect;
|
||||||
var expect = '';
|
|
||||||
|
|
||||||
printBugNumber (bug);
|
printBugNumber (bug);
|
||||||
printStatus (summary);
|
printStatus (summary);
|
||||||
|
|
||||||
var t1 = <tag1 xmlns="http://ns1"/>;
|
expect = false;
|
||||||
var n2 = new Namespace("http://ns2");
|
actual = false;
|
||||||
t1.@n2::a1="a1 from ns2";
|
|
||||||
|
|
||||||
expect = (<tag1 xmlns="http://ns1" xmlns:ns2="http://ns2" ns2:a1="a1 from ns2"/>).toXMLString();
|
try
|
||||||
actual = t1.toXMLString();
|
{
|
||||||
|
var t1 = <tag1 xmlns="http://ns1"/>;
|
||||||
|
var n2 = new Namespace("http://ns2");
|
||||||
|
t1.@n2::a1="a1 from ns2";
|
||||||
|
|
||||||
|
var t1XMLString = t1.toXMLString();
|
||||||
|
|
||||||
|
var attrMatch = /xmlns:([^=]+)="http:\/\/ns2"/.exec(t1XMLString);
|
||||||
|
if (!attrMatch)
|
||||||
|
throw "No @n2::a1 attribute present";
|
||||||
|
|
||||||
|
var nsRegexp = new RegExp(attrMatch[1] + ':a1="a1 from ns2"');
|
||||||
|
if (!nsRegexp.test(t1XMLString))
|
||||||
|
throw "No namespace declaration present for @ns2::a1";
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
actual = e;
|
||||||
|
}
|
||||||
|
|
||||||
TEST(1, expect, actual);
|
TEST(1, expect, actual);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user