assert_own_property(accountAdded, "iconUri", "accountAdded doesn't have iconUri property");
assert_own_property(accountAdded, "provider", "accountAdded doesn't have provider property");
accountRemove(accountAdded.id);
- tizen.account.removeAccountListener(id);
+ tizen.account.removeAccountListener(id);
t.done();
}),
onremoved: t.step_func(function (accountIdRemoved) {
onremoved: t.step_func(function (accountIdRemoved) {
assert_type(accountIdRemoved, "number", "accountIdRemoved should be number type");
tizen.account.removeAccountListener(watchId);
- t.done();
+ t.done();
}),
onupdated: t.step_func(function (accountUpdated) {
assert_unreached("Should be invoked to onremoved callback");
assert_own_property(accountUpdated, "iconUri", "accountUpdated doesn't have iconUri property");
assert_own_property(accountUpdated, "provider", "accountUpdated doesn't have provider property");
accountRemove(accountUpdated.id);
- tizen.account.removeAccountListener(watchId);
+ tizen.account.removeAccountListener(watchId);
t.done();
})
};
test(function () {
var appId, provider, account1, returnedValue, account2;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account1 = new tizen.Account(provider, {userName: "admin", iconUri: "/home/owner/share/tct-account-tizen-tests/icon.png"});
}),
onremoved: t.step_func(function (accountIdRemoved) {
assert_equals(accountIdRemoved, account.id, "the id should be same");
- tizen.account.removeAccountListener(watchId);
+ tizen.account.removeAccountListener(watchId);
t.done();
}),
onupdated: t.step_func(function (accountUpdated) {
test(function () {
var conversionTable, accountChangeCallback, i;
+
conversionTable = getTypeConversionExceptions("object", false);
for (i = 0; i < conversionTable.length; i++) {
accountChangeCallback = conversionTable[i][0];
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
tizen.account.addAccountListener(accountChangeCallback);
- }, TYPE_MISMATCH_EXCEPTION + " exception should be thrown - given incorrect callback argument");
+ }, "TypeMismatchError should be thrown - given incorrect callback argument");
}
}, document.title);
test(function () {
var incorrectListeners, i, accountChangeCallback;
+
incorrectListeners = getListenerConversionExceptions(["onadded", "onremoved", "onupdated"]);
for (i = 0; i < incorrectListeners.length; i++) {
accountChangeCallback = incorrectListeners[i][0];
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
tizen.account.addAccountListener(accountChangeCallback);
- }, TYPE_MISMATCH_EXCEPTION + " exception should be thrown - given incorrect callback");
+ }, "TypeMismatchError should be thrown - given incorrect callback");
}
}, document.title);
test(function () {
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
tizen.account.addAccountListener();
- }, TYPE_MISMATCH_EXCEPTION + " exception should be thrown - not given callback argument.");
+ }, "TypeMismatchError should be thrown - not given callback argument.");
}, document.title);
</script>
test(function () {
var conversionTable, i;
+
conversionTable = getTypeConversionExceptions("object", false);
for (i = 0; i < conversionTable.length; i++) {
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
tizen.account.add(conversionTable[i][0]);
- }, TYPE_MISMATCH_EXCEPTION + " exception should be thrown - given incorrect account object");
+ }, "TypeMismatchError should be thrown - given incorrect account object");
}
}, document.title);
test(function () {
var appId, provider, account1, account2;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account1 = new tizen.Account(provider, {userName: "admin", iconUri: "/home/owner/share/tct-account-tizen-tests/icon.png"});
test(function () {
var returnedValue;
+
returnedValue = tizen.account.getAccount();
assert_equals(returnedValue, null, "the returned value should be null");
}, document.title);
test(function () {
var appId, provider;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
assert_not_equals(provider, null, "provider should not be null");
test(function () {
var returnedValue;
+
returnedValue = tizen.account.getProvider();
assert_equals(returnedValue, null, "the returned value should be null");
}, document.title);
test(function () {
var appId, provider, account, returnedValue, accountGet;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider, {userName: "admin", iconUri: "/home/owner/share/tct-account-tizen-tests/icon.png"});
test(function () {
var returnedValue;
+
returnedValue = tizen.account.removeAccountListener();
assert_equals(returnedValue, undefined, "Returned value should be undefined");
}, document.title);
test(function () {
var returnedValue;
+
returnedValue = tizen.account.remove();
assert_equals(returnedValue, undefined, "Returned value should be undefined");
}, document.title);
test(function () {
var appId, provider, account1, returnedValue, account2;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account1 = new tizen.Account(provider, {userName: 'admin', iconUri: 'path/to/icon.jpg'});
test(function () {
var conversionTable, i;
+
conversionTable = getTypeConversionExceptions("object", false);
for (i = 0; i < conversionTable.length; i++) {
assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
test(function () {
var app, provider;
+
app = tizen.application.getCurrentApplication();
provider = tizen.account.getProvider(app.appInfo.id);
check_readonly(provider, "applicationId", provider.applicationId, "string", "Tizen");
test(function () {
var appId, provider;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
check_readonly(provider, "capabilities", provider.capabilities, "object", ["Tizen", "Samsung"]);
test(function () {
var appId, provider;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
check_readonly(provider, "displayName", provider.displayName, "string", "Tizen");
test(function () {
var appId, provider;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
check_extensibility(provider);
test(function () {
var app, provider;
+
app = tizen.application.getCurrentApplication();
provider = tizen.account.getProvider(app.appInfo.id);
check_readonly(provider, "iconUri", provider.iconUri, "string", "Tizen");
test(function () {
var app, provider;
+
app = tizen.application.getCurrentApplication();
provider = tizen.account.getProvider(app.appInfo.id);
check_readonly(provider, "isMultipleAccountSupported", provider.isMultipleAccountSupported, "boolean", false);
test(function () {
var app, provider;
+
app = tizen.application.getCurrentApplication();
provider = tizen.account.getProvider(app.appInfo.id);
check_readonly(provider, "smallIconUri", provider.smallIconUri, "string", "Tizen");
test(function () {
var appId, provider, account1, account2;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account1 = new tizen.Account(provider);
test(function () {
var appId, provider, account;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider);
test(function () {
var appId, provider, account;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider);
test(function () {
var appId, provider, account;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider);
//==== TEST_CRITERIA AE AT ARO
test(function () {
- var appId, provider;
+ var appId, provider, account;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider);
test(function () {
var appId, provider, account;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider);
test(function () {
var appId, provider, account;
+
appId = tizen.application.getCurrentApplication().appInfo.id;
provider = tizen.account.getProvider(appId);
account = new tizen.Account(provider);