function testPreventDefault(opts) {
                    var event, $item;

                    // The color picker needs to be displayed for this test; otherwise the
                    // selection won't be properly set, because you can only set the selection
                    // when the text field has focus.
                    makeUI(opts.color || "hsla(50, 25%, 50%, 0.5)", function () { }, defaultSwatches, false);

                    $item = colorEditor[opts.item];
                    $item.focus();
                    if (opts.selection) {
                        $item[0].setSelectionRange(opts.selection[0], opts.selection[1]);
                    }

                    event = makeKeyEvent(opts);
                    $item.trigger(event);
                    expect(event.isDefaultPrevented()).toBe(opts.expected);
                }
Test whether the given event's default is or isn't prevented on a given key.
@param {object} opts The parameters to test:
    color: An optional initial value to set in the ColorEditor. Defaults to "hsla(50, 25%, 50%, 0.5)".
    item: The (string) name of the member of ColorEditor that references the element to test.
    selection: An optional array ([start, end]) specifying the selection to set in the given element.
    key: The KeyEvent key code to simulate.
    shift: Optional boolean specifying whether to simulate the shift key being down (default false).
    expected: Whether the default is expected to be prevented.