tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

set_get_window_rect.html (1632B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>TestDriver set / get rect method</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 
      9 <script>
     10 promise_test(async t => {
     11    var orig_rect = await test_driver.get_window_rect();
     12    var new_rect = { "width": orig_rect.width, "height": orig_rect.height, "x": 150, "y": 175 };
     13    await test_driver.set_window_rect(new_rect);
     14    var result = await test_driver.get_window_rect()
     15    assert_equals(result.width, orig_rect.width, "The 'Width' property should not have changed");
     16    assert_equals(result.height, orig_rect.height, "The 'Height' property should not have changed.");
     17    assert_equals(result.x, new_rect.x, "The 'X' property has been changed.");
     18    assert_equals(result.y, new_rect.y, "The 'y' property has been changed.");
     19 }, "Window Position");
     20 
     21 promise_test(async t => {
     22    var orig_rect = await test_driver.get_window_rect();
     23    var new_rect = { "width": 800, "height": 500, "x": orig_rect.x, "y": orig_rect.y };
     24    await test_driver.set_window_rect(new_rect);
     25    var result = await test_driver.get_window_rect()
     26    assert_equals(result.width, new_rect.width, "The 'Width' property has been changed");
     27    assert_equals(result.height, new_rect.height, "The 'Height' property has been changed.");
     28    assert_equals(result.x, orig_rect.x, "The 'X' property should not have changed.");
     29    assert_equals(result.y, orig_rect.y, "The 'y' property should not have changed.");
     30 }, "Window Size");
     31 </script>