aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng
diff options
context:
space:
mode:
authorRafaƂ Jagoda2013-12-27 12:55:02 +0100
committerTobias Bosch2014-01-09 10:10:11 -0800
commit28fc80bba0107075ab371fd0a7634a38891626b2 (patch)
tree493e228fb06b3443b6808c373d07759d42aefb51 /test/ng
parentb6c42d5e8155edc9013bd531f553c278ce37c3c8 (diff)
downloadangular.js-28fc80bba0107075ab371fd0a7634a38891626b2.tar.bz2
fix($httpBackend): Allow status code 0 from any protocol
Android 4.1 stock browser also returns status code 0 when a template is loaded via `http` and the application is cached using appcache. Fixes #1356. Closes #5547.
Diffstat (limited to 'test/ng')
-rw-r--r--test/ng/httpBackendSpec.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ng/httpBackendSpec.js b/test/ng/httpBackendSpec.js
index 49514d8e..92781f9a 100644
--- a/test/ng/httpBackendSpec.js
+++ b/test/ng/httpBackendSpec.js
@@ -421,7 +421,7 @@ describe('$httpBackend', function() {
// TODO(vojta): test whether it fires "async-end" on both success and error
});
- describe('file protocol', function() {
+ describe('protocols that return 0 status code', function() {
function respond(status, content) {
xhr = MockXhr.$$lastInstance;
@@ -435,7 +435,7 @@ describe('$httpBackend', function() {
it('should convert 0 to 200 if content', function() {
$backend = createHttpBackend($browser, createMockXhr);
- $backend('GET', 'file:///whatever/index.html', null, callback);
+ $backend('GET', 'someProtocol:///whatever/index.html', null, callback);
respond(0, 'SOME CONTENT');
expect(callback).toHaveBeenCalled();
@@ -446,7 +446,7 @@ describe('$httpBackend', function() {
it('should convert 0 to 404 if no content', function() {
$backend = createHttpBackend($browser, createMockXhr);
- $backend('GET', 'file:///whatever/index.html', null, callback);
+ $backend('GET', 'someProtocol:///whatever/index.html', null, callback);
respond(0, '');
expect(callback).toHaveBeenCalled();
@@ -462,10 +462,10 @@ describe('$httpBackend', function() {
hash : "#/C:/",
host : "",
hostname : "",
- href : "file:///C:/base#!/C:/foo",
+ href : "someProtocol:///C:/base#!/C:/foo",
pathname : "/C:/foo",
port : "",
- protocol : "file:",
+ protocol : "someProtocol:",
search : "",
setAttribute: angular.noop
};