Skip to content

Commit 54c0de8

Browse files
author
Vladimir Enchev
committed
XMLHttpRequest separated from http
1 parent d3c987f commit 54c0de8

File tree

2 files changed

+46
-45
lines changed

2 files changed

+46
-45
lines changed

CrossPlatformModules.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,9 @@
17341734
<ItemGroup>
17351735
<Content Include="js-libs\esprima\README.md" />
17361736
</ItemGroup>
1737-
<ItemGroup />
1737+
<ItemGroup>
1738+
<Folder Include="apps\list-view-demo\" />
1739+
</ItemGroup>
17381740
<!-- To save maintenance effort, the Visual Studio build does not rely on the Microsoft targets.
17391741
Instead, it calls the Grunt build.
17401742
-->
@@ -1785,7 +1787,7 @@
17851787
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
17861788
</WebProjectProperties>
17871789
</FlavorProperties>
1788-
<UserProperties ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2linear-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" />
1790+
<UserProperties ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2linear-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" />
17891791
</VisualStudio>
17901792
</ProjectExtensions>
17911793
</Project>

apps/tests/http-tests.ts

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,15 @@ export var test_request_headersSentAndReceivedProperly = function (done) {
333333
method: "GET",
334334
headers: { "Content-Type": "application/json" }
335335
}).then(function (response) {
336-
result = response.headers;
337-
try {
338-
TKUnit.assert(result["Content-Type"] === "application/json", "Headers not sent/received properly!");
339-
done(null);
340-
}
341-
catch (err) {
342-
done(err);
343-
}
344-
}, function (e) {
336+
result = response.headers;
337+
try {
338+
TKUnit.assert(result["Content-Type"] === "application/json", "Headers not sent/received properly!");
339+
done(null);
340+
}
341+
catch (err) {
342+
done(err);
343+
}
344+
}, function (e) {
345345
done(e);
346346
});
347347
};
@@ -355,15 +355,15 @@ export var test_request_contentSentAndReceivedProperly = function (done) {
355355
headers: { "Content-Type": "application/x-www-form-urlencoded" },
356356
content: "MyVariableOne=ValueOne&MyVariableTwo=ValueTwo"
357357
}).then(function (response) {
358-
result = response.content.toJSON();
359-
try {
360-
TKUnit.assert(result["form"]["MyVariableOne"] === "ValueOne" && result["form"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!");
361-
done(null);
362-
}
363-
catch (err) {
364-
done(err);
365-
}
366-
}, function (e) {
358+
result = response.content.toJSON();
359+
try {
360+
TKUnit.assert(result["form"]["MyVariableOne"] === "ValueOne" && result["form"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!");
361+
done(null);
362+
}
363+
catch (err) {
364+
done(err);
365+
}
366+
}, function (e) {
367367
done(e);
368368
});
369369
};
@@ -379,15 +379,15 @@ export var test_request_NonStringHeadersSentAndReceivedProperly = function (done
379379
headers: { "Content-Type": "application/x-www-form-urlencoded", "Content-Length": postData.length },
380380
content: postData
381381
}).then(function (response) {
382-
result = response.content.toJSON();
383-
try {
384-
TKUnit.assert(result["form"]["MyVariableOne"] === "ValueOne" && result["form"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!");
385-
done(null);
386-
}
387-
catch (err) {
388-
done(err);
389-
}
390-
}, function (e) {
382+
result = response.content.toJSON();
383+
try {
384+
TKUnit.assert(result["form"]["MyVariableOne"] === "ValueOne" && result["form"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!");
385+
done(null);
386+
}
387+
catch (err) {
388+
done(err);
389+
}
390+
}, function (e) {
391391
done(e);
392392
});
393393
};
@@ -404,24 +404,23 @@ export var test_request_jsonAsContentSentAndReceivedProperly = function (done) {
404404
headers: { "Content-Type": "application/json" },
405405
content: JSON.stringify({ MyVariableOne: "ValueOne", MyVariableTwo: "ValueTwo" })
406406
}).then(function (response) {
407-
// result = response.content.toJSON();
408-
// <hide>
409-
result = response.content.toJSON();
410-
try
411-
{
412-
TKUnit.assert(result["json"]["MyVariableOne"] === "ValueOne" && result["json"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!");
413-
done(null);
414-
}
415-
catch (err) {
416-
done(err);
417-
}
407+
// result = response.content.toJSON();
408+
// <hide>
409+
result = response.content.toJSON();
410+
try {
411+
TKUnit.assert(result["json"]["MyVariableOne"] === "ValueOne" && result["json"]["MyVariableTwo"] === "ValueTwo", "Content not sent/received properly!");
412+
done(null);
413+
}
414+
catch (err) {
415+
done(err);
416+
}
418417
// </hide>
419418
// console.log(result);
420-
}, function (e) {
421-
// <hide>
419+
}, function (e) {
420+
// <hide>
422421
done(e);
423-
// </hide>
424-
// console.log("Error occurred " + e);
422+
// </hide>
423+
// console.log("Error occurred " + e);
425424
});
426425
// ```
427426
// </snippet>
@@ -452,4 +451,4 @@ function doRequest(url: string, done: Function) {
452451
}, function (e) {
453452
done(e);
454453
});
455-
}
454+
};

0 commit comments

Comments
 (0)