Home
last modified time | relevance | path

Searched refs:mock (Results 1 – 25 of 598) sorted by relevance

12345678910>>...24

/external/chromium-trace/catapult/telemetry/telemetry/testing/
Dsimple_mock_unittest.py12 mock = simple_mock.MockObject()
13 mock.ExpectCall('foo')
15 mock.foo()
18 mock = simple_mock.MockObject()
19 mock.ExpectCall('foo').WillReturn(7)
21 ret = mock.foo()
25 mock = simple_mock.MockObject()
26 mock.ExpectCall('foo').WithArgs(3, 4)
28 mock.foo(3, 4)
31 mock = simple_mock.MockObject()
[all …]
/external/gmock/test/
Dgmock_link_test.h243 Mock mock; in TEST() local
245 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return()); in TEST()
246 mock.VoidFromString(NULL); in TEST()
251 Mock mock; in TEST() local
254 EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch)); in TEST()
255 mock.StringFromString(NULL); in TEST()
260 Mock mock; in TEST() local
262 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return()); in TEST()
263 mock.VoidFromString(NULL); in TEST()
268 Mock mock; in TEST() local
[all …]
Dgmock-generated-function-mockers_test.cc406 MockStack<int> mock; in TEST() local
408 EXPECT_CALL(mock, GetSize()) in TEST()
412 EXPECT_CALL(mock, Push(_)); in TEST()
414 EXPECT_CALL(mock, GetTop()) in TEST()
416 EXPECT_CALL(mock, Pop()) in TEST()
419 EXPECT_EQ(0, mock.GetSize()); in TEST()
420 mock.Push(5); in TEST()
421 EXPECT_EQ(1, mock.GetSize()); in TEST()
422 EXPECT_EQ(5, mock.GetTop()); in TEST()
423 mock.Pop(); in TEST()
[all …]
/external/google-breakpad/src/testing/test/
Dgmock_link_test.h243 Mock mock; in TEST() local
245 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return()); in TEST()
246 mock.VoidFromString(NULL); in TEST()
251 Mock mock; in TEST() local
254 EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch)); in TEST()
255 mock.StringFromString(NULL); in TEST()
260 Mock mock; in TEST() local
262 EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return()); in TEST()
263 mock.VoidFromString(NULL); in TEST()
268 Mock mock; in TEST() local
[all …]
Dgmock-generated-function-mockers_test.cc371 MockStack<int> mock; in TEST() local
373 EXPECT_CALL(mock, GetSize()) in TEST()
377 EXPECT_CALL(mock, Push(_)); in TEST()
379 EXPECT_CALL(mock, GetTop()) in TEST()
381 EXPECT_CALL(mock, Pop()) in TEST()
384 EXPECT_EQ(0, mock.GetSize()); in TEST()
385 mock.Push(5); in TEST()
386 EXPECT_EQ(1, mock.GetSize()); in TEST()
387 EXPECT_EQ(5, mock.GetTop()); in TEST()
388 mock.Pop(); in TEST()
[all …]
/external/guava/guava-tests/test/com/google/common/cache/
DForwardingLoadingCacheTest.java38 private LoadingCache<String, Boolean> mock; field in ForwardingLoadingCacheTest
48 mock = createMock(LoadingCache.class); in setUp()
51 return mock; in setUp()
57 expect(mock.get("key")).andReturn(Boolean.TRUE); in testGet()
58 replay(mock); in testGet()
60 verify(mock); in testGet()
64 expect(mock.getUnchecked("key")).andReturn(Boolean.TRUE); in testGetUnchecked()
65 replay(mock); in testGetUnchecked()
67 verify(mock); in testGetUnchecked()
71 expect(mock.getAll(ImmutableList.of("key"))).andReturn(ImmutableMap.of("key", Boolean.TRUE)); in testGetAll()
[all …]
DForwardingCacheTest.java38 private Cache<String, Boolean> mock; field in ForwardingCacheTest
48 mock = createMock(Cache.class); in setUp()
51 return mock; in setUp()
57 expect(mock.getIfPresent("key")).andReturn(Boolean.TRUE); in testGetIfPresent()
58 replay(mock); in testGetIfPresent()
60 verify(mock); in testGetIfPresent()
64 expect(mock.getAllPresent(ImmutableList.of("key"))) in testGetAllPresent()
66 replay(mock); in testGetAllPresent()
69 verify(mock); in testGetAllPresent()
73 mock.invalidate("key"); in testInvalidate()
[all …]
/external/chromium-trace/catapult/dashboard/dashboard/
Dupdate_bug_with_results_test.py10 import mock
148 @mock.patch('apiclient.discovery.build', mock.MagicMock())
149 @mock.patch.object(utils, 'TickMonitoringCustomMetric', mock.MagicMock())
180 @mock.patch(
182 mock.MagicMock(side_effect=_MockFetch))
183 @mock.patch.object(
185 mock.MagicMock())
211 @mock.patch(
213 mock.MagicMock(side_effect=_MockFetch))
214 @mock.patch.object(
[all …]
Dfile_bug_test.py8 import mock
62 file_bug.issue_tracker_service = mock.MagicMock()
136 @mock.patch(
138 mock.MagicMock(return_value='chromeperf.appspot.com'))
139 @mock.patch.object(
141 mock.MagicMock(return_value={'issue_id': 123, 'issue_url': 'foo.com'}))
158 @mock.patch.object(
160 mock.MagicMock(return_value=[]))
161 @mock.patch.object(
163 mock.MagicMock(return_value={'issue_id': 123, 'issue_url': 'foo.com'}))
[all …]
Dbuildbucket_service_test.py9 import mock
61 @mock.patch('oauth2client.client.SignedJwtAssertionCredentials',
62 mock.MagicMock())
63 @mock.patch('httplib2.Http', mock.MagicMock())
67 with mock.patch('apiclient.discovery.build', mock.MagicMock(
82 @mock.patch('oauth2client.client.SignedJwtAssertionCredentials',
83 mock.MagicMock())
84 @mock.patch('httplib2.Http', mock.MagicMock())
88 with mock.patch('apiclient.discovery.build', mock.MagicMock(
Dissue_tracker_service_test.py6 import mock
15 @mock.patch('issue_tracker_service.discovery.build', mock.MagicMock())
20 service._MakeCommentRequest = mock.Mock()
28 service._MakeCommentRequest = mock.Mock()
34 service._MakeCommentRequest = mock.Mock()
52 service._MakeCommentRequest = mock.Mock()
65 @mock.patch('logging.error')
68 service._ExecuteRequest = mock.Mock(return_value=None)
75 service._ExecuteRequest = mock.Mock(return_value={'id': 333})
82 service._ExecuteRequest = mock.Mock(return_value={})
[all …]
/external/libchrome/base/
Dgmock_unittest.cc68 MockSampleClass mock; in TEST() local
70 EXPECT_CALL(mock, ReturnSomething()) in TEST()
74 EXPECT_EQ(1, mock.ReturnSomething()); in TEST()
75 EXPECT_EQ(2, mock.ReturnSomething()); in TEST()
76 EXPECT_EQ(3, mock.ReturnSomething()); in TEST()
78 EXPECT_CALL(mock, ReturnNothingConstly()).Times(2); in TEST()
79 mock.ReturnNothingConstly(); in TEST()
80 mock.ReturnNothingConstly(); in TEST()
85 MockSampleClass mock; in TEST() local
87 EXPECT_CALL(mock, OutputParam(_)) in TEST()
[all …]
/external/mockito/src/org/mockito/internal/util/
DMockUtil.java14 import org.mockito.mock.MockCreationSettings;
15 import org.mockito.mock.MockName;
32 T mock = mockMaker.createMock(settings, mockHandler); in createMock() local
36 new LenientCopyTool().copyToMock(spiedInstance, mock); in createMock()
39 return mock; in createMock()
42 public <T> void resetMock(T mock) { in resetMock() argument
43 InternalMockHandler oldHandler = (InternalMockHandler) getMockHandler(mock); in resetMock()
47 mockMaker.resetMock(mock, newHandler, settings); in resetMock()
50 public <T> InternalMockHandler<T> getMockHandler(T mock) { in getMockHandler() argument
51 if (mock == null) { in getMockHandler()
[all …]
/external/chromium-trace/catapult/telemetry/telemetry/internal/util/
Dbinary_manager_unittest.py10 import mock
22 @mock.patch(
24 @mock.patch(
33 mock.call.base_config.BaseConfig(
35 mock.call.base_config.BaseConfig(
41 @mock.patch(
43 @mock.patch(
52 expected_calls = [mock.call(binary_manager.TELEMETRY_PROJECT_CONFIG),
53 mock.call(binary_manager.CHROME_BINARY_CONFIG),
54 mock.call(environment_config)]
[all …]
/external/chromium-trace/catapult/devil/devil/android/
Dmd5sum_test.py14 import mock # pylint: disable=import-error
29 mock.patch('devil.devil_env._Environment.FetchPath',
30 mock.Mock(side_effect=lambda a, device=None: mocked_attrs[a])),
31 mock.patch('os.path.exists',
32 new=mock.Mock(return_value=True)),
43 mock_get_cmd_output = mock.Mock(
45 with mock.patch('devil.utils.cmd_helper.GetCmdOutput',
57 mock_get_cmd_output = mock.Mock(
60 with mock.patch('devil.utils.cmd_helper.GetCmdOutput',
76 mock_get_cmd_output = mock.Mock(
[all …]
Dfastboot_utils_test.py24 import mock # pylint: disable=import-error
43 self.file = mock.MagicMock(spec=file)
58 fastbooter = mock.Mock(spec=fastboot.Fastboot)
59 fastbooter.__str__ = mock.Mock(return_value=test_serial)
65 device = mock.Mock(spec=device_utils.DeviceUtils)
66 device.__str__ = mock.Mock(return_value=test_serial)
67 device.product_board = mock.Mock(return_value=_BOARD)
68 device.adb = mock.Mock()
99 @mock.patch('time.sleep', mock.Mock())
125 self.call.fastboot._device.WaitUntilFullyBooted(timeout=mock.ANY)):
[all …]
Dlogcat_monitor_test.py17 import mock # pylint: disable=import-error
22 test_adb.Logcat = mock.Mock(return_value=(l for l in raw_logcat))
65 @mock.patch('time.sleep', mock.Mock())
80 @mock.patch('time.sleep', mock.Mock())
91 @mock.patch('time.sleep', mock.Mock())
106 test_adb.Logcat = mock.Mock(return_value=LogGenerator())
116 @mock.patch('time.sleep', mock.Mock())
140 @mock.patch('time.sleep', mock.Mock())
152 @mock.patch('time.sleep', mock.Mock())
167 @mock.patch('time.sleep', mock.Mock())
[all …]
/external/webrtc/webrtc/modules/audio_processing/
Daudio_processing_impl_unittest.cc37 MockInitialize mock(config); in TEST() local
38 ON_CALL(mock, InitializeLocked()) in TEST()
39 .WillByDefault(Invoke(&mock, &MockInitialize::RealInitializeLocked)); in TEST()
41 EXPECT_CALL(mock, InitializeLocked()).Times(1); in TEST()
42 mock.Initialize(); in TEST()
48 EXPECT_CALL(mock, InitializeLocked()) in TEST()
50 EXPECT_NOERR(mock.ProcessStream(&frame)); in TEST()
51 EXPECT_NOERR(mock.AnalyzeReverseStream(&frame)); in TEST()
55 EXPECT_CALL(mock, InitializeLocked()) in TEST()
57 EXPECT_NOERR(mock.ProcessStream(&frame)); in TEST()
[all …]
/external/chromium-trace/catapult/third_party/gsutil/third_party/boto/tests/unit/glacier/
Dtest_vault.py24 from tests.compat import mock, unittest
26 ANY = mock.ANY
35 self.size_patch = mock.patch('os.path.getsize')
37 self.api = mock.Mock()
40 self.mock_open = mock.mock_open()
47 @mock.patch('boto.glacier.vault.compute_hashes_from_fileobj',
53 with mock.patch('boto.glacier.vault.open', self.mock_open,
60 mock.ANY, mock.ANY, 'my description')
64 self.vault.create_archive_writer = mock.Mock()
68 with mock.patch('boto.glacier.vault.open', self.mock_open,
[all …]
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DWrappingExecutorServiceTest.java48 MockExecutor mock = new MockExecutor(); in testDelegations() local
49 TestExecutor testExecutor = new TestExecutor(mock); in testDelegations()
51 mock.assertLastMethodCalled("awaitTermination"); in testDelegations()
53 mock.assertLastMethodCalled("isTerminated"); in testDelegations()
55 mock.assertLastMethodCalled("isShutdown"); in testDelegations()
57 mock.assertLastMethodCalled("shutdown"); in testDelegations()
59 mock.assertLastMethodCalled("shutdownNow"); in testDelegations()
64 MockExecutor mock = new MockExecutor(); in testExecute() local
65 TestExecutor testExecutor = new TestExecutor(mock); in testExecute()
67 mock.assertLastMethodCalled("execute"); in testExecute()
[all …]
/external/chromium-trace/catapult/dependency_manager/dependency_manager/
Ddependency_manager_unittest.py8 import mock
44 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
51 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
52 dep_info = mock.MagicMock(spec=dependency_manager.DependencyInfo)
65 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
69 dep_info1 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
72 dep_info2 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
86 base_config_mock = mock.MagicMock(spec=dependency_manager.BaseConfig)
91 dep_info1 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
94 dep_info2 = mock.MagicMock(spec=dependency_manager.DependencyInfo)
[all …]
/external/dexmaker/src/mockito/java/com/google/dexmaker/mockito/
DDexmakerMockMaker.java27 import org.mockito.mock.MockCreationSettings;
50 T mock = (T) Proxy.newProxyInstance(contextClassLoader, classesToMock, in createMock() local
52 return mock; in createMock()
60 T mock = unsafeAllocator.newInstance(proxyClass); in createMock() local
63 handlerField.set(mock, invocationHandler); in createMock()
64 return mock; in createMock()
73 public void resetMock(Object mock, MockHandler newHandler, MockCreationSettings settings) { in resetMock() argument
74 InvocationHandlerAdapter adapter = getInvocationHandlerAdapter(mock); in resetMock()
78 public MockHandler getHandler(Object mock) { in getHandler() argument
79 InvocationHandlerAdapter adapter = getInvocationHandlerAdapter(mock); in getHandler()
[all …]
/external/chromium-trace/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/testing/
Dmock_test.py7 from apitools.base.py.testing import mock
14 with mock.Client(fusiontables.FusiontablesV1) as client_class:
18 with self.assertRaises(mock.UnexpectedRequestException):
22 with mock.Client(fusiontables.FusiontablesV1) as client_class:
31 with mock.Client(fusiontables.FusiontablesV1) as client_class:
39 with mock.Client(fusiontables.FusiontablesV1) as client_class:
43 with self.assertRaises(mock.UnexpectedRequestException):
45 with self.assertRaises(mock.UnexpectedRequestException):
49 with mock.Client(fusiontables.FusiontablesV1) as client_class:
53 with self.assertRaises(mock.UnexpectedRequestException):
[all …]
/external/mockito/src/org/mockito/internal/
DMockitoCore.java29 import org.mockito.mock.MockCreationSettings;
47 public <T> T mock(Class<T> typeToMock, MockSettings settings) { in mock() method in MockitoCore
55 T mock = mockUtil.createMock(creationSettings); in mock() local
56 mockingProgress.mockingStarted(mock, typeToMock); in mock()
57 return mock; in mock()
79 public <T> T verify(T mock, VerificationMode mode) { in verify() argument
80 if (mock == null) { in verify()
82 } else if (!mockUtil.isMock(mock)) { in verify()
83 reporter.notAMockPassedToVerify(mock.getClass()); in verify()
85 mockingProgress.verificationStarted(new MockAwareVerificationMode(mock, mode)); in verify()
[all …]
/external/mockito/src/org/mockito/
DMockito.java1119 public static <T> T mock(Class<T> classToMock) { in mock() method in Mockito
1120 return mock(classToMock, withSettings().defaultAnswer(RETURNS_DEFAULTS)); in mock()
1138 public static <T> T mock(Class<T> classToMock, String name) { in mock() method in Mockito
1139 return mock(classToMock, withSettings() in mock()
1192 public static <T> T mock(Class<T> classToMock, ReturnValues returnValues) { in mock() method in Mockito
1193 …return mock(classToMock, withSettings().defaultAnswer(new AnswerReturnValuesAdapter(returnValues))… in mock()
1215 public static <T> T mock(Class<T> classToMock, Answer defaultAnswer) { in mock() method in Mockito
1216 return mock(classToMock, withSettings().defaultAnswer(defaultAnswer)); in mock()
1242 public static <T> T mock(Class<T> classToMock, MockSettings mockSettings) { in mock() method in Mockito
1243 return MOCKITO_CORE.mock(classToMock, mockSettings); in mock()
[all …]

12345678910>>...24