Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / credentialmanager / localcredential-basics.html
index be5325d..854cc3b 100644 (file)
@@ -5,15 +5,17 @@
 <script src="/serviceworker/resources/interfaces.js"></script>
 <script>
 test(function() {
-    var credential = new LocalCredential('id', 'name', 'https://example.com/avatar.png', 'pencil');
+    var credential = new LocalCredential('id', 'pencil', 'name', 'https://example.com/avatar.png');
 
-    verifyInterface('LocalCredential', credential, {
+    verify_interface('LocalCredential', credential, {
+        formData: 'object',
         id: 'string',
         name: 'string',
         avatarURL: 'string',
         password: 'string'
     });
 
+    assert_true(credential.formData instanceof FormData);
     assert_equals(credential.id, 'id');
     assert_equals(credential.name, 'name');
     assert_equals(credential.avatarURL, 'https://example.com/avatar.png');
@@ -22,7 +24,27 @@ test(function() {
 
 test(function() {
     assert_throws(new SyntaxError(), function () {
-        var credential = new LocalCredential('id', 'name', '-', 'pencil');
+        var credential = new LocalCredential('id', 'pencil', 'name', '-');
     });
 }, 'Construct a LocalCredential with an invalid avatar URL.');
+
+test(function() {
+    var credential = new LocalCredential('id', 'pencil', 'name');
+
+    assert_equals(credential.id, 'id');
+    assert_equals(credential.name, 'name');
+    assert_equals(credential.avatarURL, '');
+    assert_equals(credential.password, 'pencil');
+
+}, 'Construct a LocalCredential with an empty avatar URL.');
+
+test(function() {
+    var credential = new LocalCredential('id', 'pencil');
+
+    assert_equals(credential.id, 'id');
+    assert_equals(credential.name, '');
+    assert_equals(credential.avatarURL, '');
+    assert_equals(credential.password, 'pencil');
+
+}, 'Construct a LocalCredential with an empty name and avatar URL.');
 </script>