304
304
switchSync.serverProperty = "checked";
307
// function test_backend_change() {
308
// switchBackend.checked = true;
309
// compare(switchControl.checked, true, "Switch should have been toggled");
310
// switchBackend.checked = false;
311
// compare(switchControl.checked, false, "Switch should have been toggled");
314
// function test_frontend_change() {
315
// switchControl.clicked();
316
// tryCompare(switchBackend, "checked", true);
319
// function test_frontend_change_with_value() {
320
// slider.value = 60;
321
// tryCompare(sliderBackend, "value", 60);
324
// function test_break_binding_change() {
325
// switchControl.checked = true;
326
// switchBackend.checked = true;
327
// switchBackend.checked = false;
328
// compare(switchControl.checked, false, "Switch should have been toggled");
307
function test_backend_change() {
308
switchBackend.checked = true;
309
compare(switchControl.checked, true, "Switch should have been toggled");
310
switchBackend.checked = false;
311
compare(switchControl.checked, false, "Switch should have been toggled");
314
function test_frontend_change() {
315
switchControl.clicked();
316
tryCompare(switchBackend, "checked", true);
319
function test_frontend_change_with_value() {
321
tryCompare(sliderBackend, "value", 60);
324
function test_break_binding_change() {
325
switchControl.checked = true;
326
switchBackend.checked = true;
327
switchBackend.checked = false;
328
compare(switchControl.checked, false, "Switch should have been toggled");
331
331
function test_buffered_change_with_value() {
332
332
slider.value = 60;
339
339
tryCompare(sliderBackend, "value", 90);
342
// function test_connect_to_another_object() {
343
// switchSync.serverTarget = switchBackend2;
344
// switchSync.serverProperty = "checked2";
346
// switchBackend2.checked2 = true;
347
// compare(switchControl.checked, true, "Switch should have been toggled");
348
// switchBackend2.checked2 = false;
349
// compare(switchControl.checked, false, "Switch should have been toggled");
352
// function test_client_revert() {
353
// switchBackend.timer.interval = 500;
354
// switchControl.clicked();
355
// compare(switchControl.checked, true);
356
// tryCompare(switchControl, "checked", false);
359
// function test_user_trigger() {
362
// compare(apSyncActivatedSpy.count, 1, "Triggering should have caused signal to be emitted");
363
// tryCompare(apBackend, "active", true);
364
// compare(apMenu.active, true, "User value should have updated to match server");
367
// function test_user_trigger_doesnt_activate_on_user_property_change() {
368
// apMenu.active = true;
369
// compare(apSyncActivatedSpy.count, 0);
342
function test_connect_to_another_object() {
343
switchSync.serverTarget = switchBackend2;
344
switchSync.serverProperty = "checked2";
346
switchBackend2.checked2 = true;
347
compare(switchControl.checked, true, "Switch should have been toggled");
348
switchBackend2.checked2 = false;
349
compare(switchControl.checked, false, "Switch should have been toggled");
352
function test_client_revert() {
353
switchBackend.timer.interval = 500;
354
switchControl.clicked();
355
compare(switchControl.checked, true);
356
tryCompare(switchControl, "checked", false);
359
function test_user_trigger() {
362
compare(apSyncActivatedSpy.count, 1, "Triggering should have caused signal to be emitted");
363
tryCompare(apBackend, "active", true);
364
compare(apMenu.active, true, "User value should have updated to match server");
367
function test_user_trigger_doesnt_activate_on_user_property_change() {
368
apMenu.active = true;
369
compare(apSyncActivatedSpy.count, 0);