selenium-webdriver
Version:
The official WebDriver JavaScript bindings from the Selenium project
22 lines • 13.4 kB
HTML
<meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.testing.MockControl</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.testing.MockControl</h1><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l44">code »</a></header><section><p>Controls a set of mocks. Controlled mocks are replayed, verified, and
cleaned-up at the same time.<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.testing.MockControl <span class="args">( )</span></span></div></div></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l69">code »</a><span class="member"><a name="$replayAll">$replayAll</a> <span class="args">( )</span></span></div><p>Calls replay on each controlled mock.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l79">code »</a><span class="member"><a name="$resetAll">$resetAll</a> <span class="args">( )</span></span></div><p>Calls reset on each controlled mock.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l99">code »</a><span class="member"><a name="$tearDown">$tearDown</a> <span class="args">( )</span></span></div><p>Calls tearDown on each controlled mock, if necesssary.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l89">code »</a><span class="member"><a name="$verifyAll">$verifyAll</a> <span class="args">( )</span></span></div><p>Calls verify on each controlled mock.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l60">code »</a><span class="member"><a name="addMock">addMock</a> <span class="args">( mock )</span> ⇒ <code class="type"><a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a></code></span></div><p>Takes control of this mock.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>mock: <code class="type"><a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a></code><dd>Mock to be controlled.</dl><tr><th>Returns<tr><td><dl>The same mock passed in,
for convenience.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l198">code »</a><span class="member"><a name="createConstructorMock">createConstructorMock</a> <span class="args">( scope, constructorName, opt_strictness )</span> ⇒ <code class="type">!<a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a></code></span></div><p>Creates a controlled MethodMock for a constructor. Passes its arguments
through to the MethodMock constructor. See
<code class="type"><a href="namespace_goog_testing.html#goog.testing.createConstructorMock">goog.testing.createConstructorMock</a></code> for details.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>scope: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code><dd>The scope of the constructor to be mocked out.<dt>constructorName: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the function we're going to mock.<dt>opt_strictness: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>One of goog.testing.Mock.LOOSE or
goog.testing.Mock.STRICT. The default is STRICT.</dl><tr><th>Returns<tr><td><dl>The mocked method.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l163">code »</a><span class="member"><a name="createFunctionMock">createFunctionMock</a> <span class="args">( opt_functionName, opt_strictness )</span> ⇒ <code class="type"><a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a></code></span></div><p>Creates a controlled FunctionMock. Passes its arguments through to the
FunctionMock constructor.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>opt_functionName: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd>The optional name of the function to mock
set to '[anonymous mocked function]' if not passed in.<dt>opt_strictness: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>One of goog.testing.Mock.LOOSE or
goog.testing.Mock.STRICT. The default is STRICT.</dl><tr><th>Returns<tr><td><dl>The mocked function.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l215">code »</a><span class="member"><a name="createGlobalFunctionMock">createGlobalFunctionMock</a> <span class="args">( functionName, opt_strictness )</span> ⇒ <code class="type"><a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a></code></span></div><p>Creates a controlled GlobalFunctionMock. Passes its arguments through to the
GlobalFunctionMock constructor.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>functionName: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the function we're going to mock.<dt>opt_strictness: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>One of goog.testing.Mock.LOOSE or
goog.testing.Mock.STRICT. The default is STRICT.</dl><tr><th>Returns<tr><td><dl>The mocked function.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l144">code »</a><span class="member"><a name="createLooseMock">createLooseMock</a> <span class="args">( objectToMock, opt_ignoreUnexpectedCalls, opt_mockStaticMethods, opt_createProxy )</span> ⇒ <code class="type">!<a href="class_goog_testing_LooseMock.html">goog.testing.LooseMock</a></code></span></div><p>Creates a controlled LooseMock. Passes its arguments through to the
LooseMock constructor.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>objectToMock: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The object that should be mocked, or
the constructor of an object to mock.<dt>opt_ignoreUnexpectedCalls: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>Whether to ignore unexpected
calls.<dt>opt_mockStaticMethods: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>An optional argument denoting that
a mock should be constructed from the static functions of a class.<dt>opt_createProxy: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>An optional argument denoting that
a proxy for the target mock should be created.</dl><tr><th>Returns<tr><td><dl>The mock object.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l180">code »</a><span class="member"><a name="createMethodMock">createMethodMock</a> <span class="args">( scope, functionName, opt_strictness )</span> ⇒ <code class="type">!<a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a></code></span></div><p>Creates a controlled MethodMock. Passes its arguments through to the
MethodMock constructor.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>scope: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></code><dd>The scope of the method to be mocked out.<dt>functionName: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd>The name of the function we're going to mock.<dt>opt_strictness: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>=</code><dd>One of goog.testing.Mock.LOOSE or
goog.testing.Mock.STRICT. The default is STRICT.</dl><tr><th>Returns<tr><td><dl>The mocked method.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l122">code »</a><span class="member"><a name="createStrictMock">createStrictMock</a> <span class="args">( objectToMock, opt_mockStaticMethods, opt_createProxy )</span> ⇒ <code class="type">!<a href="class_goog_testing_StrictMock.html">goog.testing.StrictMock</a></code></span></div><p>Creates a controlled StrictMock. Passes its arguments through to the
StrictMock constructor.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>objectToMock: <code class="type">(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>|<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">Function</a>)</code><dd>The object that should be mocked, or
the constructor of an object to mock.<dt>opt_mockStaticMethods: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>An optional argument denoting that
a mock should be constructed from the static functions of a class.<dt>opt_createProxy: <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>=</code><dd>An optional argument denoting that
a proxy for the target mock should be created.</dl><tr><th>Returns<tr><td><dl>The mock object.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/testing/mockcontrol.js.src.html#l50">code »</a><span class="member"><a name="mocks_">mocks_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>.<<a href="interface_goog_testing_MockInterface.html">goog.testing.MockInterface</a>></code></span></div><p>The list of mocks being controlled.</summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>