Beispiel #1
0
        protected override void OnBeginRequest()
        {
            base.OnBeginRequest();

            if (ClearAppleAdapters())
            {
                if (Request.UserAgent?.Contains("AppleWebKit") ?? false)
                {
                    Request.Browser.Adapters.Clear();
                }
            }

            var path = Request.GetRelativePath();

            if (path == "/KeepAlive.ashx")
            {
                Response.EndWith("Kept alive");
            }

            // Backwards compatibility:
            if (path == "/tasks.ashx" && WebTestManager.IsTddExecutionMode())
            {
                WebTestManager.DispatchTasksList();
            }

            ProcessPagesFolderPrefix(path);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes the <see cref="T:System.Web.UI.HtmlTextWriter"/> object and calls on the child controls of the <see cref="T:System.Web.UI.Page"/> to render.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> that receives the page content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (InsertCommonResourcesEnabled)
            {
                InsertCommonResources();
            }

            ReferenceRegisteredScripts();

            var originalPath = Context.Items["ORIGINAL.REQUEST.PATH"] as string;

            if (originalPath.HasValue())
            {
                Context.RewritePath(originalPath);
            }

            //  NeatCssTagManager.RenderPage(base.Render, writer);
            base.Render(writer);

            // if (HttpApplication.TempDatabaseInitiated == false) throw new Exception("FALSE!!");
            // if (HttpApplication.TempDatabaseInitiated == null) throw new Exception("NULL!!");

            if (WebTestManager.IsTddExecutionMode() &&
                Request.FilePath.EndsWith(".aspx", StringComparison.OrdinalIgnoreCase) &&
                !IsCallback && !Request.IsAjaxCall())
            {
                writer.Write(WebTestManager.GetWebTestWidgetHtml(Request));
            }
        }
Beispiel #3
0
 void ProcessInjectedFiles()
 {
     if (!WebTestManager.IsTddExecutionMode())
     {
         return;
     }
     if (Request.Files == null || Request.Files.Count == 0)
     {
         return;
     }
     foreach (var key in Request.Form.AllKeys.Where(k => k.EndsWith("_InjectedContents")))
     {
         var fileKey = key.TrimEnd("_InjectedContents");
         Request.Files.InjectFile(fileKey, Convert.FromBase64String(Request.Form[key]), Request.Form[fileKey + "_InjectedFileName"], "application/octet-stream");
     }
 }