Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: appengine/config_service/ui/test/config-ui/config-set_test.html

Issue 2983203002: config_service: make UI adjustable for mobile (Closed)
Patch Set: config_service: prompt user to sign in when appropriate. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/ui/test/config-ui/config-set_test.html
diff --git a/appengine/config_service/ui/test/config-ui/config-set_test.html b/appengine/config_service/ui/test/config-ui/config-set_test.html
index 06f80c4c70ed545ac7eed68967f713c94d79d13b..a2702849d2ee8bb223ffc42489917352c7e811c9 100644
--- a/appengine/config_service/ui/test/config-ui/config-set_test.html
+++ b/appengine/config_service/ui/test/config-ui/config-set_test.html
@@ -251,6 +251,54 @@
}.bind(config_set));
});
});
+
+ suite('Unsuccessful fetch of config files', function() {
+ var ajax;
+ var request;
+ var server;
+ var responseHeaders = {
+ json: { 'Content-Type': 'application/json' }
+ };
+ var config_set;
+
+ setup(function() {
+ server = sinon.fakeServer.create();
+ var param = {
+ error: {
+ code: 403,
+ message: "Error 403"
+ }
+ }
+ server.respondWith(
+ 'GET',
+ /\/_ah\/api\/config\/v1\/config-sets\?config_set=([a-z\-]+)\/([a-z\-]+)&include_files=true&include_last_import_attempt=true/,
+ [
+ 403,
+ responseHeaders.json,
+ JSON.stringify(param)
+ ]
+ );
+ config_set = fixture('valid-project-with-config-files');
+ ajax = Polymer.dom(config_set.root).querySelector('#requestConfigs');
+ });
+
+ teardown(function() {
+ server.restore();
+ });
+
+ test('displays error if fetch failed', function (done) {
+ request = ajax.generateRequest();
+ server.respond();
+ assert.equal(request.status, 403);
+ config_set.addEventListener('fetchError', function() {
+ assert.equal(config_set.isLoading, false);
+ assert.equal(config_set.errorMessage, "Authorization required to view this config set." +
+ " You need to sign in first.");
+ done();
+ }.bind(config_set));
+ });
+ });
+
</script>
</body>
</html>
« no previous file with comments | « appengine/config_service/ui/src/config-ui/front-page.html ('k') | appengine/swarming/server/task_request.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698