anchor.diff:          machine.succeed(
               ru(
                   "${xdo "submit-url" ''
  -                  search --sync --onlyvisible --name "new tab"
  +                  search --sync --onlyvisible --name "New Tab"
                     windowfocus --sync
                     key --delay 1000 Return
                   ''}"
  
positive.code: 
  
      def create_new_win():
          with machine.nested("Creating a new Chromium window"):
              status, _ = machine.execute(
                  ru(
                      "${xdo "new-window" ''
                        search --onlyvisible --name "startup done"
                        windowfocus --sync
                        windowactivate --sync
                      ''}"
                  )
              )
              if status == 0:
                  machine.execute(
                      ru(
                          "${xdo "new-window" ''
                            key Ctrl+n
                          ''}"
                      )
                  )
  
  
      def close_win():
          def try_close(_):
              status, _ = machine.execute(
                  ru(
                      "${xdo "close-window" ''
                        search --onlyvisible --name "new tab"
                        windowfocus --sync
                        windowactivate --sync
                      ''}"
                  )
              )
              if status == 0:
                  machine.execute(
                      ru(
                          "${xdo "close-window" ''
                            key Ctrl+w
                          ''}"
                      )
                  )
              for _ in range(1, 20):
                  status, _ = machine.execute(
                      ru(
                          "${xdo "wait-for-close" ''
                            search --onlyvisible --name "new tab"
                          ''}"
                      )
                  )
                  if status != 0:
                      return True
                  machine.sleep(1)
                  return False
  
          retry(try_close)
  
  
      def wait_for_new_win():
          ret = False
          with machine.nested("Waiting for new Chromium window to appear"):
              for _ in range(1, 20):
                  status, _ = machine.execute(
                      ru(
                          "${xdo "wait-for-window" ''
                            search --onlyvisible --name "new tab"
                            windowfocus --sync
                            windowactivate --sync
                          ''}"
                      )
                  )
                  if status == 0:
                      ret = True
                      machine.sleep(10)
                      break
                  machine.sleep(1)
          return ret
  
  
      def create_and_wait_for_new_win():
          for _ in range(1, 3):
              create_new_win()
              if wait_for_new_win():
                  return True
          assert False, "new window did not appear within 60 seconds"
  
  
      @contextmanager
      def test_new_win(description):
          create_and_wait_for_new_win()
          with machine.nested(description):
              yield
          close_win()
  
  
      machine.wait_for_x()
  
negative.code:         machine.succeed(
              ru(
                  "${xdo "find-window" ''
                    search --sync --onlyvisible --name "Sandbox Status"
                    windowfocus --sync
                  ''}"
              )
  