Esempio n. 1
0
        public void ResolveTypeReferencesCommandParameterTest2()
        {
            Protocol p = ProtocolProcessor.LoadProtocol(new[] { DeploymentItems.Inspector10 }, "Chrome-1.0");

            ProtocolProcessor.ResolveTypeReferences(p, new Dictionary <string, string>());

            var addInspectedNodeCommand = p.GetDomain("Console").GetCommand("addInspectedNode");
            var nodeId = addInspectedNodeCommand.GetParameter("nodeId");

            Assert.AreEqual("integer", nodeId.TypeName);
        }
Esempio n. 2
0
        public void ResolveTypeReferencesCommandParameterTest()
        {
            Protocol p = ProtocolProcessor.LoadProtocol(new[] { DeploymentItems.Inspector10 }, "Chrome-1.0");

            ProtocolProcessor.ResolveTypeReferences(p, new Dictionary <string, string>());

            var evaluateCommand  = p.GetDomain("Runtime").GetCommand("evaluate");
            var frameIdParameter = evaluateCommand.GetParameter("frameId");

            Assert.AreEqual("string", frameIdParameter.TypeName);
        }
Esempio n. 3
0
        public void ResolveTypeReferencesCommandReturnValueTest2()
        {
            Dictionary <string, string> explicitMappings = new Dictionary <string, string>();

            explicitMappings.Add("GenericTypes.SearchMatch", "Debugger.SearchMatch");

            Protocol p = ProtocolProcessor.LoadProtocol(new[] { DeploymentItems.InspectoriOS8 }, "iOS-8.0");

            ProtocolProcessor.ResolveTypeReferences(p, explicitMappings);

            var searchInResourceCommand = p.GetDomain("Page").GetCommand("searchInResource");
            var searchMatchArray        = searchInResourceCommand.Returns.Single();

            Assert.AreEqual("Debugger.SearchMatch[]", searchMatchArray.TypeName);
        }
Esempio n. 4
0
        public void ResolveTypeReferencesCommandReturnValueTest()
        {
            Dictionary <string, string> explicitMappings = new Dictionary <string, string>();

            explicitMappings.Add("Page.Cookie", "Network.Cookie");

            Protocol p = ProtocolProcessor.LoadProtocol(new[] { DeploymentItems.InspectoriOS8 }, "iOS-8.0");

            ProtocolProcessor.ResolveTypeReferences(p, explicitMappings);

            var getCookiesCommand = p.GetDomain("Page").GetCommand("getCookies");
            var cookieArray       = getCookiesCommand.Returns.Single();

            Assert.AreEqual("Network.Cookie[]", cookieArray.TypeName);
        }
        public void EqualsTest()
        {
            var inspector11 = ProtocolProcessor.LoadProtocol(new[] { DeploymentItems.Inspector11 }, "inspector-1.1");
            var protocol    = ProtocolProcessor.LoadProtocol(new[] { DeploymentItems.BrowserProtocol, DeploymentItems.JsProtocol }, "protocol");

            ProtocolProcessor.ResolveTypeReferences(inspector11, new Dictionary <string, string>());
            ProtocolProcessor.ResolveTypeReferences(protocol, new Dictionary <string, string>());

            var stopScreencast10  = inspector11.GetDomain("Page").GetCommand("stopScreencast");
            var stopScreencastTip = protocol.GetDomain("Page").GetCommand("stopScreencast");

            // Quick fact check: both methods have the same string equivalent,
            // void stopScreencast()
            Assert.AreEqual <string>(stopScreencast10.ToString(), stopScreencastTip.ToString());

            Assert.IsTrue(stopScreencast10.Equals(stopScreencastTip));
            Assert.IsTrue(stopScreencastTip.Equals(stopScreencast10));
        }