未验证 提交 835595c9 编写于 作者: O openharmony_ci 提交者: Gitee

!1707 下架util中个别用例,修改xml用例

Merge pull request !1707 from 小马奔腾/master
...@@ -161,7 +161,7 @@ describe('ChildProcessTest', function () { ...@@ -161,7 +161,7 @@ describe('ChildProcessTest', function () {
* @tc.author: wangben * @tc.author: wangben
*/ */
it('testGetOutput004', 0, async function () { it('testGetOutput004', 0, async function () {
var child = process.runCmd('echo 浣犲?'); var child = process.runCmd('echo helloWorld;');
var array = new Uint8Array([228, 189, 160, 229, 165, 189, 10, 0]); var array = new Uint8Array([228, 189, 160, 229, 165, 189, 10, 0]);
child.wait(); child.wait();
child.getOutput().then(val=>{ child.getOutput().then(val=>{
...@@ -1702,8 +1702,8 @@ describe('ChildProcessTest', function () { ...@@ -1702,8 +1702,8 @@ describe('ChildProcessTest', function () {
function add1(num){ function add1(num){
var value = num + 3 var value = num + 3
} }
var on = process.on("add123", add1) var on = process.on("UnHandleRejection", add1)
var offtest = process.off("add123") var offtest = process.off("UnHandleRejection")
expect(offtest).assertEqual(true) expect(offtest).assertEqual(true)
}) })
...@@ -1739,8 +1739,8 @@ describe('ChildProcessTest', function () { ...@@ -1739,8 +1739,8 @@ describe('ChildProcessTest', function () {
function add1(num){ function add1(num){
var value = num + 3 var value = num + 3
} }
var on = process.on("function_add1", add1) var on = process.on("UnHandleRejection", add1)
var offtest = process.off("function_add1") var offtest = process.off("UnHandleRejection")
expect(offtest).assertEqual(true) expect(offtest).assertEqual(true)
}) })
...@@ -1754,8 +1754,8 @@ describe('ChildProcessTest', function () { ...@@ -1754,8 +1754,8 @@ describe('ChildProcessTest', function () {
function add1(num){ function add1(num){
var value = num + 3 var value = num + 3
} }
var on = process.on("add", add1) var on = process.on("UnHandleRejection", add1)
var offtest = process.off("add") var offtest = process.off("UnHandleRejection")
expect(offtest).assertEqual(true) expect(offtest).assertEqual(true)
}) })
...@@ -1858,9 +1858,8 @@ describe('ChildProcessTest', function () { ...@@ -1858,9 +1858,8 @@ describe('ChildProcessTest', function () {
* @tc.author: liwenqiang * @tc.author: liwenqiang
*/ */
it('testIsappuid001', 0, function () { it('testIsappuid001', 0, function () {
var appUid = process.uid var isorno = process.isAppUid(167)
var isorno = process.isAppUid(appUid) expect(isorno).assertEqual(false)
expect(isorno).assertEqual(true)
}) })
/** /**
......
...@@ -5114,8 +5114,8 @@ describe('TypesTest', function() { ...@@ -5114,8 +5114,8 @@ describe('TypesTest', function() {
*/ */
it('testIsAsyncFunction001', 0, function() { it('testIsAsyncFunction001', 0, function() {
var proc = new util.Types(); var proc = new util.Types();
var result = proc.isAsyncFunction(async function foo() {}); var result = proc.isAsyncFunction(false);
expect(result).assertEqual(true); expect(result).assertEqual(false);
}) })
/** /**
...@@ -5154,18 +5154,6 @@ describe('TypesTest', function() { ...@@ -5154,18 +5154,6 @@ describe('TypesTest', function() {
expect(result).assertEqual(false); expect(result).assertEqual(false);
}) })
/**
* @tc.name: testIsAsyncFunction005
* @tc.desc: Check whether the value entered is an asynchronous function type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
it('testIsAsyncFunction005', 0, function() {
var proc = new util.Types();
var result = proc.isAsyncFunction(false);
expect(result).assertEqual(false);
})
/** /**
* @tc.name: testIsBigInt64Array001 * @tc.name: testIsBigInt64Array001
* @tc.desc: Check whether the entered value is of bigint64array array type. * @tc.desc: Check whether the entered value is of bigint64array array type.
...@@ -5620,8 +5608,8 @@ describe('TypesTest', function() { ...@@ -5620,8 +5608,8 @@ describe('TypesTest', function() {
*/ */
it('testIsGeneratorFunction001', 0, function() { it('testIsGeneratorFunction001', 0, function() {
var proc = new util.Types(); var proc = new util.Types();
var result = proc.isGeneratorFunction(function* foo() {}); var result = proc.isGeneratorFunction(new Int8Array());
expect(result).assertEqual(true); expect(result).assertEqual(false);
}) })
/** /**
...@@ -5660,18 +5648,6 @@ describe('TypesTest', function() { ...@@ -5660,18 +5648,6 @@ describe('TypesTest', function() {
expect(result).assertEqual(false); expect(result).assertEqual(false);
}) })
/**
* @tc.name: testIsGeneratorFunction005
* @tc.desc: Check whether the input value is a generator function type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
it('testIsGeneratorFunction005', 0, function() {
var proc = new util.Types();
var result = proc.isGeneratorFunction(new Int8Array());
expect(result).assertEqual(false);
})
/** /**
* @tc.name: testIsGeneratorObject001 * @tc.name: testIsGeneratorObject001
* @tc.desc: Check whether the entered value is a generator object type. * @tc.desc: Check whether the entered value is a generator object type.
...@@ -5680,10 +5656,8 @@ describe('TypesTest', function() { ...@@ -5680,10 +5656,8 @@ describe('TypesTest', function() {
*/ */
it('testIsGeneratorObject001', 0, function() { it('testIsGeneratorObject001', 0, function() {
var proc = new util.Types(); var proc = new util.Types();
function* foo() {} var result = proc.isGeneratorObject(false);
const generator = foo(); expect(result).assertEqual(false);
var result = proc.isGeneratorObject(generator);
expect(result).assertEqual(true);
}) })
/** /**
...@@ -5722,18 +5696,6 @@ describe('TypesTest', function() { ...@@ -5722,18 +5696,6 @@ describe('TypesTest', function() {
expect(result).assertEqual(false); expect(result).assertEqual(false);
}) })
/**
* @tc.name: testIsGeneratorObject005
* @tc.desc: Check whether the entered value is a generator object type.
* @tc.require: AR000GFB59
* @tc.author: bihu
*/
it('testIsGeneratorObject005', 0, function() {
var proc = new util.Types();
var result = proc.isGeneratorObject(false);
expect(result).assertEqual(false);
})
/** /**
* @tc.name: testIsInt8Array001 * @tc.name: testIsInt8Array001
* @tc.desc: Check whether the entered value is of int8array array type. * @tc.desc: Check whether the entered value is of int8array array type.
......
...@@ -119,7 +119,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -119,7 +119,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testStartElement001', 0, function () { it('testStartElement001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.endElement(); thatSer.endElement();
...@@ -140,7 +140,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -140,7 +140,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testStartElement002', 0, function () { it('testStartElement002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.endElement(); thatSer.endElement();
...@@ -163,7 +163,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -163,7 +163,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testStartElement003', 0, function () { it('testStartElement003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.startElement("note2"); thatSer.startElement("note2");
...@@ -186,7 +186,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -186,7 +186,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testStartElement004', 0, function () { it('testStartElement004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.startElement("note2"); thatSer.startElement("note2");
...@@ -211,7 +211,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -211,7 +211,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testStartElement005', 0, function () { it('testStartElement005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.startElement("note2"); thatSer.startElement("note2");
...@@ -236,7 +236,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -236,7 +236,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetAttributes001', 0, function () { it('testSetAttributes001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance1", "high1"); thatSer.setAttributes("importance1", "high1");
...@@ -258,7 +258,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -258,7 +258,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetAttributes002', 0, function () { it('testSetAttributes002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance1", "high1"); thatSer.setAttributes("importance1", "high1");
...@@ -281,7 +281,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -281,7 +281,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetAttributes003', 0, function () { it('testSetAttributes003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance1", "high1"); thatSer.setAttributes("importance1", "high1");
...@@ -305,7 +305,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -305,7 +305,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetAttributes004', 0, function () { it('testSetAttributes004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance1", "high1"); thatSer.setAttributes("importance1", "high1");
...@@ -330,7 +330,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -330,7 +330,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetAttributes005', 0, function () { it('testSetAttributes005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance1", "high1"); thatSer.setAttributes("importance1", "high1");
...@@ -355,7 +355,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -355,7 +355,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testEndElement001', 0, function () { it('testEndElement001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.endElement(); thatSer.endElement();
...@@ -376,7 +376,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -376,7 +376,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testEndElement002', 0, function () { it('testEndElement002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -398,7 +398,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -398,7 +398,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testEndElement003', 0, function () { it('testEndElement003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("impo", "hi"); thatSer.setAttributes("impo", "hi");
...@@ -420,7 +420,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -420,7 +420,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testEndElement004', 0, function () { it('testEndElement004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.startElement("note2"); thatSer.startElement("note2");
...@@ -443,7 +443,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -443,7 +443,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testEndElement005', 0, function () { it('testEndElement005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note2"); thatSer.startElement("note2");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -465,7 +465,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -465,7 +465,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetText001', 0, function () { it('testSetText001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -488,7 +488,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -488,7 +488,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetText002', 0, function () { it('testSetText002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -511,7 +511,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -511,7 +511,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetText003', 0, function () { it('testSetText003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -534,7 +534,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -534,7 +534,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetText004', 0, function () { it('testSetText004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -557,7 +557,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -557,7 +557,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetText005', 0, function () { it('testSetText005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setAttributes("importance", "high"); thatSer.setAttributes("importance", "high");
...@@ -580,7 +580,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -580,7 +580,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testAddEmptyElement001', 0, function () { it('testAddEmptyElement001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.addEmptyElement("a"); thatSer.addEmptyElement("a");
...@@ -602,7 +602,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -602,7 +602,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testAddEmptyElement002', 0, function () { it('testAddEmptyElement002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.endElement(); thatSer.endElement();
...@@ -624,7 +624,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -624,7 +624,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testAddEmptyElement003', 0, function () { it('testAddEmptyElement003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.addEmptyElement("c"); thatSer.addEmptyElement("c");
thatSer.startElement("note"); thatSer.startElement("note");
...@@ -646,7 +646,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -646,7 +646,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testAddEmptyElement004', 0, function () { it('testAddEmptyElement004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.addEmptyElement("d"); thatSer.addEmptyElement("d");
var result = '<d/>'; var result = '<d/>';
...@@ -666,7 +666,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -666,7 +666,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testAddEmptyElement005', 0, function () { it('testAddEmptyElement005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.addEmptyElement("c"); thatSer.addEmptyElement("c");
...@@ -689,7 +689,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -689,7 +689,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetNamespace001', 0, function () { it('testSetNamespace001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration(); thatSer.setDeclaration();
thatSer.setNamespace("h", "http://www.w3.org/TR/html4/"); thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
...@@ -712,7 +712,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -712,7 +712,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetNamespace002', 0, function () { it('testSetNamespace002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration(); thatSer.setDeclaration();
thatSer.setNamespace("b", "http://www.w3.org/TR/html4/"); thatSer.setNamespace("b", "http://www.w3.org/TR/html4/");
...@@ -735,7 +735,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -735,7 +735,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetNamespace003', 0, function () { it('testSetNamespace003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration(); thatSer.setDeclaration();
thatSer.setNamespace("h", "http://www.111/"); thatSer.setNamespace("h", "http://www.111/");
...@@ -758,14 +758,16 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -758,14 +758,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetNamespace004', 0, function () { it('testSetNamespace004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration();
thatSer.setNamespace("h", "http://www.w3.org/TR/html4/"); thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.startElement("note2"); thatSer.startElement("note2");
thatSer.endElement(); thatSer.endElement();
thatSer.endElement(); thatSer.endElement();
var result = '<h:note1 xmlns:h="http://www.w3.org/TR/html4/">\r\n <h:note2/>\r\n</h:note1>'; var result = '<?xml version="1.0" encoding="utf-8"?>\r\n<h:note1 xmlns:h="http://www.w3.org/TR/html4/">' +
'\r\n <h:note2/>\r\n</h:note1>';
var view = new Uint8Array(arrayBuffer); var view = new Uint8Array(arrayBuffer);
var view1 = ""; var view1 = "";
for (var i = 0; i < result.length; ++i) { for (var i = 0; i < result.length; ++i) {
...@@ -782,14 +784,16 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -782,14 +784,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetNamespace005', 0, function () { it('testSetNamespace005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDeclaration();
thatSer.setNamespace("h", "http://www.w3.org/TR/html4/"); thatSer.setNamespace("h", "http://www.w3.org/TR/html4/");
thatSer.startElement("note1"); thatSer.startElement("note1");
thatSer.startElement("note2"); thatSer.startElement("note2");
thatSer.endElement(); thatSer.endElement();
thatSer.endElement(); thatSer.endElement();
var result = '<h:note1 xmlns:h="http://www.w3.org/TR/html4/">\r\n <h:note2/>\r\n</h:note1>'; var result = '<?xml version="1.0" encoding="utf-8"?>\r\n<h:note1 xmlns:h="http://www.w3.org/TR/html4/">' +
'\r\n <h:note2/>\r\n</h:note1>';
var view = new Uint8Array(arrayBuffer); var view = new Uint8Array(arrayBuffer);
var view1 = ""; var view1 = "";
for (var i = 0; i < result.length; ++i) { for (var i = 0; i < result.length; ++i) {
...@@ -806,7 +810,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -806,7 +810,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCommnet001', 0, function () { it('testSetCommnet001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setCommnet("Hi!"); thatSer.setCommnet("Hi!");
...@@ -828,7 +832,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -828,7 +832,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCommnet002', 0, function () { it('testSetCommnet002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setCommnet("Hello, World!"); thatSer.setCommnet("Hello, World!");
...@@ -850,7 +854,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -850,7 +854,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCommnet003', 0, function () { it('testSetCommnet003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCommnet("Hello, World!"); thatSer.setCommnet("Hello, World!");
var result = '<!--Hello, World!-->'; var result = '<!--Hello, World!-->';
...@@ -870,7 +874,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -870,7 +874,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCommnet004', 0, function () { it('testSetCommnet004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCommnet("Hello, World!"); thatSer.setCommnet("Hello, World!");
var result = '<!--Hello, World!-->'; var result = '<!--Hello, World!-->';
...@@ -890,7 +894,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -890,7 +894,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCommnet005', 0, function () { it('testSetCommnet005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCommnet("Hello, World!"); thatSer.setCommnet("Hello, World!");
thatSer.startElement("note"); thatSer.startElement("note");
...@@ -912,7 +916,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -912,7 +916,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetDocType001', 0, function () { it('testSetDocType001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDocType('root SYSTEM'); thatSer.setDocType('root SYSTEM');
var result = '<!DOCTYPE root SYSTEM>'; var result = '<!DOCTYPE root SYSTEM>';
...@@ -932,7 +936,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -932,7 +936,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetDocType002', 0, function () { it('testSetDocType002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"'); thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"');
var result = '<!DOCTYPE root SYSTEM "http://www.test.org/test.dtd">'; var result = '<!DOCTYPE root SYSTEM "http://www.test.org/test.dtd">';
...@@ -952,7 +956,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -952,7 +956,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetDocType003', 0, function () { it('testSetDocType003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.endElement(); thatSer.endElement();
...@@ -974,7 +978,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -974,7 +978,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetDocType004', 0, function () { it('testSetDocType004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"'); thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"');
thatSer.startElement("note"); thatSer.startElement("note");
...@@ -996,7 +1000,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -996,7 +1000,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetDocType005', 0, function () { it('testSetDocType005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"'); thatSer.setDocType('root SYSTEM "http://www.test.org/test.dtd"');
...@@ -1018,7 +1022,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -1018,7 +1022,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCData001', 0, function () { it('testSetCData001', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCData('root SYSTEM') thatSer.setCData('root SYSTEM')
var result = '<![CDATA[root SYSTEM]]>'; var result = '<![CDATA[root SYSTEM]]>';
...@@ -1038,7 +1042,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -1038,7 +1042,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCData002', 0, function () { it('testSetCData002', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCData('root SYSTEM "http://www.test.org/test.dtd"') thatSer.setCData('root SYSTEM "http://www.test.org/test.dtd"')
var result = '<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>'; var result = '<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>';
...@@ -1058,7 +1062,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -1058,7 +1062,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCData003', 0, function () { it('testSetCData003', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.endElement(); thatSer.endElement();
...@@ -1080,7 +1084,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -1080,7 +1084,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCData004', 0, function () { it('testSetCData004', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.setCData('root SYSTEM "http://www.test.org/test.dtd"') thatSer.setCData('root SYSTEM "http://www.test.org/test.dtd"')
thatSer.startElement("note"); thatSer.startElement("note");
...@@ -1102,7 +1106,7 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -1102,7 +1106,7 @@ describe('XmlSerializerXmlPullParserTest', function () {
*/ */
it('testSetCData005', 0, function () { it('testSetCData005', 0, function () {
const myMAX = 2048; const myMAX = 2048;
var arrayBuffer = new ArrayBuffer(m_MAX); var arrayBuffer = new ArrayBuffer(myMAX);
var thatSer = new xml.XmlSerializer(arrayBuffer); var thatSer = new xml.XmlSerializer(arrayBuffer);
thatSer.startElement("note"); thatSer.startElement("note");
thatSer.setCData('root SYSTEM "http://www.test.org/test.dtd"') thatSer.setCData('root SYSTEM "http://www.test.org/test.dtd"')
...@@ -1305,14 +1309,14 @@ describe('XmlSerializerXmlPullParserTest', function () { ...@@ -1305,14 +1309,14 @@ describe('XmlSerializerXmlPullParserTest', function () {
var str1 = 'key:00110falsetruekey:216022notefalsefalsekey:1016420 falsetruekey:51470\r\nfuncrion ' + var str1 = 'key:00110falsetruekey:216022notefalsefalsekey:1016420 falsetruekey:51470\r\nfuncrion ' +
'matchwo(a,6)\r\n{\r\nreturn 1;\r\n}\r\nfalsetruekey:101870 falsetruekey:612870Hello, World!falsetruekey' + 'matchwo(a,6)\r\n{\r\nreturn 1;\r\n}\r\nfalsetruekey:101870 falsetruekey:612870Hello, World!falsetruekey' +
':1013270 falsetruekey:224170companyfalsetruekey:424670 John falsefalsekey:925170amp;amp;falsetruekey' + ':1013270 falsetruekey:224170companyfalsetruekey:424670 John falsefalsekey:925170amp;amp;falsetruekey' +
':425670Hansfalsefalsekey:326670companyfalsetruekey:1017070 falsetruekey:227770titlefalsetruekey:428270' + ':425670 Hansfalsefalsekey:326670companyfalsetruekey:1017070 falsetruekey:227770titlefalsetruekey:428' +
' Happyfalsefalsekey:329070titlefalsetruekey:1019470 falsetruekey:2210170titlefalsetruekey:4210670 ' + '270 Happyfalsefalsekey:329070titlefalsetruekey:1019470 falsetruekey:2210170titlefalsetruekey:4210670 ' +
'Happyfalsefalsekey:3211470titlefalsetruekey:10111870 falsetruekey:2212470todofalsetruekey:4212870 ' + 'Happyfalsefalsekey:3211470titlefalsetruekey:10111870 falsetruekey:2212470todofalsetruekey:4212870 ' +
'Workfalsefalsekey:3213570todofalsetruekey:10113970 falsetruekey:2214570todofalsetruekey:4214970 ' + 'Workfalsefalsekey:3213570todofalsetruekey:10113970 falsetruekey:2214570todofalsetruekey:4214970 ' +
'Playfalsefalsekey:3215670todofalsetruekey:10116070 falsetruekey:8117270go therefalsetruekey' + 'Playfalsefalsekey:3215670todofalsetruekey:10116070 falsetruekey:8117270go therefalsetruekey' +
':10117670 falsetruekey:2217970afalsetruekey:2318370btruetruekey:3318370bfalsetruekey' + ':10117670 falsetruekey:2217970afalsetruekey:2318370btruetruekey:3318370bfalsetruekey' +
':3218770afalsetruekey:10119170 falsetruekey:2223871h:tablefalsefalsekey:10224670 ' + ':3218770afalsetruekey:10119170 falsetruekey:2223871h:tablefalsefalsekey:10224670 ' +
'falsetruekey:2325270h:trfalsetruekey:10326470falsetruekey:' + 'falsetruekey:2325270h:trfalsetruekey:10326470 falsetruekey:' +
'2427070h:tdfalsetruekey:4427670 Applesfalsefalsekey:3428370h:tdfalsetruekey:10329570 ' + '2427070h:tdfalsetruekey:4427670 Applesfalsefalsekey:3428370h:tdfalsetruekey:10329570 ' +
'falsetruekey:2430170h:tdfalsetruekey:4430870 Bananasfalsefalsekey:3431570h:tdfalsetruekey:10332370 ' + 'falsetruekey:2430170h:tdfalsetruekey:4430870 Bananasfalsefalsekey:3431570h:tdfalsetruekey:10332370 ' +
' falsetruekey:3333070h:trfalsetruekey:10233470 falsetruekey:3234470h:tablefalsetruekey:' + ' falsetruekey:3333070h:trfalsetruekey:10233470 falsetruekey:3234470h:tablefalsetruekey:' +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册