コード例 #1
0
ファイル: ie7.py プロジェクト: blockspacer/chromium-1
def InvokeBrowser(path):
    """Invoke the IE browser.

  Args:
    path: full path to browser

  Returns:
    A tuple of (main window, process handle, address bar,
                render_pane, tab_window)
  """
    # Invoke IE
    (ieproc, iewnd) = windowing.InvokeAndWait(path)

    # Get windows we'll need
    for tries in xrange(10):
        try:
            address_bar = windowing.FindChildWindow(
                iewnd, "WorkerW|Navigation Bar/ReBarWindow32/"
                "Address Band Root/ComboBoxEx32/ComboBox/Edit")
            render_pane = windowing.FindChildWindow(
                iewnd, "TabWindowClass/Shell DocObject View")
            tab_window = windowing.FindChildWindow(
                iewnd,
                "CommandBarClass/ReBarWindow32/TabBandClass/DirectUIHWND")
        except IndexError:
            time.sleep(1)
            continue
        break

    return (iewnd, ieproc, address_bar, render_pane, tab_window)
コード例 #2
0
def InvokeBrowser(path):
    """Invoke the Chrome browser.

  Args:
    path: full path to browser

  Returns:
    A tuple of (main window, process handle, address bar, render pane)
  """

    # Reuse an existing instance of the browser if we can find one. This
    # may not work correctly, especially if the window is behind other windows.

    # TODO(jhaas): make this work with Vista
    wnds = windowing.FindChildWindows(0, "Chrome_XPFrame")
    if len(wnds):
        wnd = wnds[0]
        proc = None
    else:
        # Invoke Chrome
        (proc, wnd) = windowing.InvokeAndWait(path)

    # Get windows we'll need
    address_bar = windowing.FindChildWindow(wnd, "Chrome_AutocompleteEdit")
    render_pane = GetChromeRenderPane(wnd)

    return (wnd, proc, address_bar, render_pane)
コード例 #3
0
ファイル: firefox2.py プロジェクト: Havok380/chromium-test
def InvokeBrowser(path):
  """Invoke the Firefox browser.

  Args:
    path: full path to browser

  Returns:
    A tuple of (main window, process handle, render pane)
  """
  # Reuse an existing instance of the browser if we can find one. This
  # may not work correctly, especially if the window is behind other windows.
  wnds = windowing.FindChildWindows(0, "MozillaUIWindowClass")
  if len(wnds):
    wnd = wnds[0]
    proc = None
  else:
    # Invoke Firefox
    (proc, wnd) = windowing.InvokeAndWait(path)

  # Get the content pane
  render_pane = windowing.FindChildWindow(
    wnd,
    "MozillaWindowClass/MozillaWindowClass/MozillaWindowClass")

  return (wnd, proc, render_pane)
コード例 #4
0
def GetBrowser(path):
    """Invoke the Firefox browser and return the process and window.

  Args:
    path: full path to browser

  Returns:
    A tuple of (process handle, render pane)
  """
    if not path: path = DEFAULT_PATH

    # Invoke Firefox
    (proc, wnd) = windowing.InvokeAndWait(path)

    # Get the content pane
    render_pane = windowing.FindChildWindow(
        wnd, "MozillaWindowClass/MozillaWindowClass/MozillaWindowClass")

    return (proc, wnd, render_pane)