browser_wa_properties-view-edit-02.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Tests that properties are not updated when modifying the VariablesView.
  5. */
  6. add_task(function* () {
  7. let { target, panel } = yield initWebAudioEditor(COMPLEX_CONTEXT_URL);
  8. let { panelWin } = panel;
  9. let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
  10. let gVars = PropertiesView._propsView;
  11. let started = once(gFront, "start-context");
  12. let events = Promise.all([
  13. getN(gFront, "create-node", 8),
  14. waitForGraphRendered(panelWin, 8, 8)
  15. ]);
  16. reload(target);
  17. let [actors] = yield events;
  18. let nodeIds = actors.map(actor => actor.actorID);
  19. click(panelWin, findGraphNode(panelWin, nodeIds[3]));
  20. // Wait for the node to be set as well as the inspector to come fully into the view
  21. yield Promise.all([
  22. waitForInspectorRender(panelWin, EVENTS),
  23. once(panelWin, EVENTS.UI_INSPECTOR_TOGGLED),
  24. ]);
  25. let errorEvent = once(panelWin, EVENTS.UI_SET_PARAM_ERROR);
  26. try {
  27. yield modifyVariableView(panelWin, gVars, 0, "bufferSize", 2048);
  28. } catch (e) {
  29. // we except modifyVariableView to fail here, because bufferSize is not writable
  30. }
  31. yield errorEvent;
  32. checkVariableView(gVars, 0, {bufferSize: 4096}, "check that unwritable variable is not updated");
  33. yield teardown(target);
  34. });