Ejemplo n.º 1
0
        /// <summary>
        /// Set the browser's viewport size
        /// </summary>
        public void ResizeBrowserWindow(int width, int height)
        {
            var originalWindowDimensions = TfsBrowserWindow.GetDimensions();

            BrowserNativeMethods.ShowWindow(TfsBrowserWindow.WindowHandle, BrowserNativeMethods.ShowWindowCommands.SW_SHOWNORMAL);
            BrowserNativeMethods.SetWindowPos(TfsBrowserWindow.WindowHandle, IntPtr.Zero, 0, 0, width, height, BrowserNativeMethods.SetWindowPosFlags.ShowWindow);

            TfsBrowserWindow.WaitOnJScriptExpressionTrue(String.Format("(window.outerWidth !== {0}) && (window.outerHeight !== {1})",
                                                                       originalWindowDimensions.OuterWidth, originalWindowDimensions.OuterHeight));
            // Logger.Instance.LogInfo("Resizing the browser window to " + width + " x " + height);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Maximize the browser window's viewport
 /// </summary>
 public void Maximize()
 {
     BrowserNativeMethods.ShowWindow(TfsBrowserWindow.WindowHandle, BrowserNativeMethods.ShowWindowCommands.SW_MAXIMIZE);
 }