/// <summary>
        /// Get Test Data file path
        /// </summary>
        /// <param name="callStackIndex"></param>
        /// <returns></returns>
        private string GetTestDataFile(int callStackIndex = 1)
        {
            StackTrace st           = new StackTrace();
            StackFrame sf           = st.GetFrame(callStackIndex);
            string     testCaseName = sf.GetMethod().Name;

            String h264TestDataPath;

            if (!PtfPropUtility.GetStringPtfProperty(TestSite, "RdpegfxH264TestDataPath", out h264TestDataPath))
            {
                Site.Assert.Fail("Cannot get its test data path");
            }

            return(h264TestDataPath + @"\" + testCaseName + ".xml");
        }
        /// <summary>
        /// Load Rdpedisp test image RdpedispTestImage
        /// </summary>
        /// <returns></returns>
        private Bitmap LoadImage()
        {
            // Load Rdpedisp test image
            String RdpedispTestImagePath;
            Bitmap testImage = null;

            if (!PtfPropUtility.GetStringPtfProperty(this.TestSite, "RdpedispTestImage", out RdpedispTestImagePath))
            {
                RdpedispTestImagePath = "";
                return(null);
            }
            try
            {
                testImage = new Bitmap(RdpedispTestImagePath);
            }
            catch (System.IO.FileNotFoundException)
            {
                this.TestSite.Log.Add(LogEntryKind.TestError, "File {0} not find.", RdpedispTestImagePath);
            }
            return(testImage);
        }
Beispiel #3
0
        /// <summary>
        /// Get Test Image Data
        /// </summary>
        private void GetTestData()
        {
            testData = new RdpegfxTestUtility();

            // Load clearcodec image
            String RdpegfxClearCodecImagePath;

            if (!PtfPropUtility.GetStringPtfProperty(TestSite, "ClearCodecImage", out RdpegfxClearCodecImagePath))
            {
                RdpegfxClearCodecImagePath = "";
            }

            try
            {
                testData.ClearCodecImage = (Bitmap)Image.FromFile(RdpegfxClearCodecImagePath);
            }
            catch (System.IO.FileNotFoundException)
            {
                testData.ClearCodecImage = RdpegfxTestUtility.captureFromScreen(0, 0, RdpegfxTestUtility.surfWidth, RdpegfxTestUtility.surfHeight);
            }

            // Load RfxProgressiveCodec image
            String RdpegfxRfxProgCodecImagePath;

            if (!PtfPropUtility.GetStringPtfProperty(TestSite, "RfxProgressiveCodecImage", out RdpegfxRfxProgCodecImagePath))
            {
                RdpegfxRfxProgCodecImagePath = "";
            }
            try
            {
                testData.RfxProgCodecImage = (Bitmap)Image.FromFile(RdpegfxRfxProgCodecImagePath);
            }
            catch (System.IO.FileNotFoundException)
            {
                testData.RfxProgCodecImage = RdpegfxTestUtility.captureFromScreen(0, 0, RdpegfxTestUtility.surfWidth, RdpegfxTestUtility.surfHeight);
            }
        }
Beispiel #4
0
        private void LoadConfig()
        {
            string tempStr;

            if (PtfPropUtility.GetStringPtfProperty(Site, "RDP.ServerName", out tempStr))
            {
                serverName = tempStr;
            }

            serverPort = int.Parse(Site.Properties["RDP.ServerPort"]);

            if (PtfPropUtility.GetStringPtfProperty(Site, "RDP.ClientName", out tempStr))
            {
                localAddress = tempStr;
            }

            string strWaitTime = Site.Properties["WaitTime"];

            if (strWaitTime != null)
            {
                int waitSeconds = Int32.Parse(strWaitTime);
                timeout = new TimeSpan(0, 0, waitSeconds);
            }
        }