예제 #1
0
        private static void StartPersistantTest(Domain d)
        {
            lock (TestProccessStatusLocker)
            {
                if (ms_tps == TestProcessStatus.Ready)
                {
                    //Domain
                    ms_domain = d;

                    //清空log区
                    ms_dgv.Rows.Clear();

                    //重置Close Flag
                    ms_IsClosed = false;

                    //准备vba脚本对象
                    ms_vbaobjects = new Dictionary <string, IVBAObject>();
                    IVBAObject ivo = new VBATask();
                    ms_vbaobjects.Add(ivo.Name, ivo);

                    //小心处理伪Log对象
                    ms_testlog = new VBATestLog(false);
                    ms_testlog.MessageEvent += new VBATestLog.ScriptPauseEventHandler(MessageHandler);
                    ms_vbaobjects.Add(ms_testlog.Name, ms_testlog);

                    ivo = new VBATestIE();
                    ms_vbaobjects.Add(ivo.Name, ivo);
                    ivo = new VBAUtility();
                    ms_vbaobjects.Add(ivo.Name, ivo);
                    ivo = new VBAHtml();
                    ms_vbaobjects.Add(ivo.Name, ivo);

                    ms_tp = TestPhase.Nonstarted;
                    Thread t = new Thread(BeforeTestHandler);
                    t.Name = "Thread For Persistant Test";
                    t.Start();
                }
                else if (ms_tps == TestProcessStatus.Singlestep_Pause)
                {
                    //改成持续运行模式
                    ms_testlog.TurnPersistance();
                    //放行
                    ms_testlog.PulseOne();
                }

                ms_tps = TestProcessStatus.Persistence;
                RefreshTestToolButtons();
            }
        }
        private static void StartPersistantTest(Domain d)
        {
            lock (TestProccessStatusLocker)
            {
                if (ms_tps == TestProcessStatus.Ready)
                {
                    //Domain
                    ms_domain = d;

                    //清空log区
                    ms_dgv.Rows.Clear();

                    //重置Close Flag
                    ms_IsClosed = false;

                    //准备vba脚本对象
                    ms_vbaobjects = new Dictionary<string, IVBAObject>();
                    IVBAObject ivo = new VBATask();
                    ms_vbaobjects.Add(ivo.Name, ivo);

                    //小心处理伪Log对象
                    ms_testlog = new VBATestLog(false);
                    ms_testlog.MessageEvent += new VBATestLog.ScriptPauseEventHandler(MessageHandler);
                    ms_vbaobjects.Add(ms_testlog.Name, ms_testlog);

                    ivo = new VBATestIE();
                    ms_vbaobjects.Add(ivo.Name, ivo);
                    ivo = new VBAUtility();
                    ms_vbaobjects.Add(ivo.Name, ivo);
                    ivo = new VBAHtml();
                    ms_vbaobjects.Add(ivo.Name, ivo);

                    ms_tp = TestPhase.Nonstarted;
                    Thread t = new Thread(BeforeTestHandler);
                    t.Name = "Thread For Persistant Test";
                    t.Start();
                }
                else if (ms_tps == TestProcessStatus.Singlestep_Pause)
                {
                    //改成持续运行模式
                    ms_testlog.TurnPersistance();
                    //放行
                    ms_testlog.PulseOne();
                }

                ms_tps = TestProcessStatus.Persistence;
                RefreshTestToolButtons();
            }
  
        }