~nick-dedekind/ubuntu-settings-components/1390136.laggy-backends

« back to all changes in this revision

Viewing changes to tests/qmltests/Components/tst_ServerPropertySynchroniser.qml

  • Committer: Nick Dedekind
  • Date: 2015-03-20 15:52:24 UTC
  • Revision ID: nick.dedekind@canonical.com-20150320155224-qjl92dr8ponj0thz
reverted test changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
            switchSync.serverProperty = "checked";
305
305
        }
306
306
 
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");
312
 
//        }
313
 
 
314
 
//        function test_frontend_change() {
315
 
//            switchControl.clicked();
316
 
//            tryCompare(switchBackend, "checked", true);
317
 
//        }
318
 
 
319
 
//        function test_frontend_change_with_value() {
320
 
//            slider.value = 60;
321
 
//            tryCompare(sliderBackend, "value", 60);
322
 
//        }
323
 
 
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");
329
 
//        }
 
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");
 
312
        }
 
313
 
 
314
        function test_frontend_change() {
 
315
            switchControl.clicked();
 
316
            tryCompare(switchBackend, "checked", true);
 
317
        }
 
318
 
 
319
        function test_frontend_change_with_value() {
 
320
            slider.value = 60;
 
321
            tryCompare(sliderBackend, "value", 60);
 
322
        }
 
323
 
 
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");
 
329
        }
330
330
 
331
331
        function test_buffered_change_with_value() {
332
332
            slider.value = 60;
339
339
            tryCompare(sliderBackend, "value", 90);
340
340
        }
341
341
 
342
 
//        function test_connect_to_another_object() {
343
 
//            switchSync.serverTarget = switchBackend2;
344
 
//            switchSync.serverProperty = "checked2";
345
 
 
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");
350
 
//        }
351
 
 
352
 
//        function test_client_revert() {
353
 
//            switchBackend.timer.interval = 500;
354
 
//            switchControl.clicked();
355
 
//            compare(switchControl.checked, true);
356
 
//            tryCompare(switchControl, "checked", false);
357
 
//        }
358
 
 
359
 
//        function test_user_trigger() {
360
 
//            apMenu.trigger();
361
 
 
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");
365
 
//        }
366
 
 
367
 
//        function test_user_trigger_doesnt_activate_on_user_property_change() {
368
 
//            apMenu.active = true;
369
 
//            compare(apSyncActivatedSpy.count, 0);
370
 
//        }
 
342
        function test_connect_to_another_object() {
 
343
            switchSync.serverTarget = switchBackend2;
 
344
            switchSync.serverProperty = "checked2";
 
345
 
 
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");
 
350
        }
 
351
 
 
352
        function test_client_revert() {
 
353
            switchBackend.timer.interval = 500;
 
354
            switchControl.clicked();
 
355
            compare(switchControl.checked, true);
 
356
            tryCompare(switchControl, "checked", false);
 
357
        }
 
358
 
 
359
        function test_user_trigger() {
 
360
            apMenu.trigger();
 
361
 
 
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");
 
365
        }
 
366
 
 
367
        function test_user_trigger_doesnt_activate_on_user_property_change() {
 
368
            apMenu.active = true;
 
369
            compare(apSyncActivatedSpy.count, 0);
 
370
        }
371
371
    }
372
372
}