Lines Matching refs:t

12 export async function test(t, { setPortalChild, cleanupPortal }) {  argument
15 const describeWithPermissions = shouldSkipTestsRequiringPermissions ? t.xdescribe : t.describe;
31 t.beforeAll(async () => {
39 originalTimeout = t.jasmine.DEFAULT_TIMEOUT_INTERVAL;
40 t.jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout * 3;
43 t.afterAll(() => {
44 t.jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
47 t.beforeEach(async () => {
49 t.expect(status).toEqual('granted');
52 t.afterEach(async () => {
57 t.describe('Camera.getCameraPermissionsAsync', () => {
58 t.it('is granted', async () => {
60 t.expect(status).toEqual('granted');
64 t.describe('Camera.getMicrophonePermissionsAsync', () => {
65 t.it('is granted', async () => {
67 t.expect(status).toEqual('granted');
72 t.describe('Camera.getSupportedRatiosAsync', () => {
73 t.it('returns an array of strings', async () => {
76 t.expect(ratios instanceof Array).toBe(true);
77 t.expect(ratios.length).toBeGreaterThan(0);
84 t.describe('Camera.takePictureAsync', () => {
85 t.it('returns a local URI', async () => {
88 t.expect(picture).toBeDefined();
89 t.expect(picture.uri).toMatch(/^file:\/\//);
92 t.it('returns `width` and `height` of the image', async () => {
95 t.expect(picture).toBeDefined();
96 t.expect(picture.width).toBeDefined();
97 t.expect(picture.height).toBeDefined();
100 t.it('returns EXIF only if requested', async () => {
103 t.expect(picture).toBeDefined();
104 t.expect(picture.exif).not.toBeDefined();
107 t.expect(picture).toBeDefined();
108 t.expect(picture.exif).toBeDefined();
111 t.it('adds additional EXIF only if requested', async () => {
119 t.expect(picture).toBeDefined();
120 t.expect(picture.exif).not.toBeDefined();
123 t.expect(picture).toBeDefined();
124 t.expect(picture.exif).toBeDefined();
125 t.expect(picture.exif.GPSLatitude).toBe(additionalExif.GPSLatitude);
126 t.expect(picture.exif.GPSLongitude).toBe(additionalExif.GPSLongitude);
127 t.expect(picture.exif.GPSAltitude).toBe(additionalExif.GPSAltitude);
130 t.it(
136 t.expect(picture).toBeDefined();
137 t.expect(picture.base64).not.toBeDefined();
140 t.expect(picture).toBeDefined();
141 t.expect(picture.base64).toBeDefined();
142 t.expect(picture.base64).not.toContain('\n');
143 t.expect(picture.base64).not.toContain('\r');
147 t.it('returns proper `exif.Flash % 2 = 0` if the flash is off', async () => {
152 t.expect(picture).toBeDefined();
153 t.expect(picture.exif).toBeDefined();
154 t.expect(picture.exif.Flash % 2 === 0).toBe(true);
163 t.it('returns proper `exif.Flash % 2 = 1` if the flash is on', async () => {
168 t.expect(picture).toBeDefined();
169 t.expect(picture.exif).toBeDefined();
170 t.expect(picture.exif.Flash % 2 === 1).toBe(true);
176 t.it('returns `exif.WhiteBalance = 1` if white balance is manually set', async () => {
185 t.expect(picture).toBeDefined();
186 t.expect(picture.exif).toBeDefined();
187 t.expect(picture.exif.WhiteBalance).toEqual(1);
190 t.it('returns `exif.WhiteBalance = 0` if white balance is set to auto', async () => {
199 t.expect(picture).toBeDefined();
200 t.expect(picture.exif).toBeDefined();
201 t.expect(picture.exif.WhiteBalance).toEqual(0);
205 t.it('returns `exif.LensModel ~= back` if camera type is set to back', async () => {
210 t.expect(picture).toBeDefined();
211 t.expect(picture.exif).toBeDefined();
212 t.expect(picture.exif.LensModel).toMatch('back');
216 t.it('returns `exif.LensModel ~= front` if camera type is set to front', async () => {
221 t.expect(picture).toBeDefined();
222 t.expect(picture.exif).toBeDefined();
223 t.expect(picture.exif.LensModel).toMatch('front');
227 t.it('returns `exif.DigitalZoom ~= false` if zoom is not set', async () => {
230 t.expect(picture).toBeDefined();
231 t.expect(picture.exif).toBeDefined();
232 t.expect(picture.exif.DigitalZoomRatio).toBeFalsy();
236 t.it('returns `exif.DigitalZoom ~= false` if zoom is set to 0', async () => {
239 t.expect(picture).toBeDefined();
240 t.expect(picture.exif).toBeDefined();
241 t.expect(picture.exif.DigitalZoomRatio).toBeFalsy();
247 t.it('returns `exif.DigitalZoom > 0` if zoom is set', async () => {
250 t.expect(picture).toBeDefined();
251 t.expect(picture.exif).toBeDefined();
252 t.expect(picture.exif.DigitalZoomRatio).toBeGreaterThan(0);
257 t.it(
262 t.expect(picture).toBeDefined();
263 t.expect(picture.exif).toBeDefined();
264 t.expect(picture.exif.DigitalZoomRatio).toBeGreaterThan(smallerRatio);
272 t.describe('Camera.recordAsync', () => {
273 t.beforeEach(async () => {
279 t.it('returns a local URI', async () => {
285 t.expect(response).toBeDefined();
286 t.expect(response.uri).toMatch(/^file:\/\//);
290 t.it('throws for an unavailable codec', async () => {
298 t.expect(error.message).toMatch(/(?=.*codec)(?=.*is not supported)/i);
302 t.it('returns available codecs', async () => {
304 t.expect(codecs).toBeDefined();
305 t.expect(codecs.length).toBeGreaterThan(0);
311 t.it('stops the recording after maxDuration', async () => {
317 t.it('the video has a duration near maxDuration', async () => {
324 t.expect(video.durationMillis).toBeLessThan(2250);
325 t.expect(video.durationMillis).toBeGreaterThan(1750);
340 t.expect(video.durationMillis).toBeLessThan(2250);
341 t.expect(video.durationMillis).toBeGreaterThan(1750);
344 t.it('records using the front camera', async () => {
356 t.it('records using the front camera and Camera2 API', async () => {
368 t.it('stops the recording after maxFileSize', async () => {
373 t.describe('can record consecutive clips', () => {
375 t.beforeAll(() => {
376 defaultTimeoutInterval = t.jasmine.DEFAULT_TIMEOUT_INTERVAL;
377 t.jasmine.DEFAULT_TIMEOUT_INTERVAL = defaultTimeoutInterval * 2;
380 t.afterAll(() => {
381 t.jasmine.DEFAULT_TIMEOUT_INTERVAL = defaultTimeoutInterval;
384 t.it('started/stopped manually', async () => {
394 t.expect(recordedVideo).toBeDefined();
395 t.expect(recordedVideo.uri).toBeDefined();
407 t.it('started/stopped automatically', async () => {