Esempio n. 1
0
        private void FetchCssFiles_(List <string> missingCssList, string[] testIds)
        {
            logger_.Log(TraceLevel.Info, testIds, Stage.Check, StageType.DomScript, new { missingCssList });
            List <CssTreeNode> cssTreeNodes = new List <CssTreeNode>();

            foreach (string missingCssUrl in missingCssList)
            {
                if (missingCssUrl.StartsWith("blob:") || missingCssUrl.StartsWith("data:"))
                {
                    logger_.Log(TraceLevel.Warn, testIds, Stage.Check, StageType.DomScript,
                                new { message = "trying to download something impossible", missingCssUrl });
                    cssData_.Add(missingCssUrl, string.Empty);
                    continue;
                }
                CssTreeNode cssTreeNode = new CssTreeNode(missingCssUrl, logger_, OnCssDownloadComplete_);
                cssTreeNodes.Add(cssTreeNode);
                AutoResetEvent waitHandle = new AutoResetEvent(false);
                waitHandles_[cssTreeNode] = waitHandle;
                cssTreeNode.Run(testIds);
            }
        }
Esempio n. 2
0
        private void FetchCssFiles_(List <string> missingCssList)
        {
            logger_.Verbose("enter");
            List <CssTreeNode> cssTreeNodes = new List <CssTreeNode>();

            foreach (string missingCssUrl in missingCssList)
            {
                if (missingCssUrl.StartsWith("blob:") || missingCssUrl.StartsWith("data:"))
                {
                    logger_.Log("trying to download something impossible: {0}", missingCssUrl);
                    cssData_.Add(missingCssUrl, string.Empty);
                    continue;
                }
                logger_.Verbose("Downloading {0}", missingCssUrl);
                CssTreeNode cssTreeNode = new CssTreeNode(missingCssUrl, logger_, OnCssDownloadComplete_);
                cssTreeNodes.Add(cssTreeNode);
                AutoResetEvent waitHandle = new AutoResetEvent(false);
                logger_.Verbose("creating waithandle {0}", waitHandle.GetHashCode());
                waitHandles_[cssTreeNode] = waitHandle;
                cssTreeNode.Run();
            }
            logger_.Verbose("exit");
        }