repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
mikita-kandratsyeu/crypto-wallet-app
src/components/Setting.tsx
<gh_stars>0 import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { Switch, TouchableOpacity } from 'react-native-gesture-handler'; import { Icon } from '.'; import { colors, fonts, sizes } from '../constants'; import { SettingProps } from './types'; export const Setting: React.FC<Se...
mikita-kandratsyeu/crypto-wallet-app
src/screens/Profile.tsx
<reponame>mikita-kandratsyeu/crypto-wallet-app<gh_stars>0 import React, { useState } from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; import { MainLayoutWrapper } from '.'; import { Icon, SectionTitle, Setting } from '../components'; import ...
mikita-kandratsyeu/crypto-wallet-app
src/screens/Market.tsx
<reponame>mikita-kandratsyeu/crypto-wallet-app<filename>src/screens/Market.tsx import React, { useCallback, useEffect, useRef } from 'react'; import { View, Text, StyleSheet, FlatList, Animated, Image, } from 'react-native'; import { connect } from 'react-redux'; import { LineChart } from 'react-native-char...
mikita-kandratsyeu/crypto-wallet-app
src/navigation/types.ts
export interface TabsProps { isTradeModalVisible: boolean; setTradeModalVisibility: (isVisible: boolean) => any; }
mikita-kandratsyeu/crypto-wallet-app
src/store/tab/tab.actions.ts
<gh_stars>0 import { Dispatch } from 'redux'; export const SET_TRADE_MODAL_VISIBILITY = 'SET_TRADE_MODAL_VISIBILITY'; export const setTradeModalVisibilitySuccess = (isVisible: boolean) => ({ type: SET_TRADE_MODAL_VISIBILITY, payload: { isVisible }, }); export const setTradeModalVisibility = (isVisible: boolean...
mikita-kandratsyeu/crypto-wallet-app
src/components/TabBarCustomButton.tsx
<gh_stars>0 import React from 'react'; import { StyleSheet, TouchableOpacity } from 'react-native'; import { TabBarCustomButtonProps } from './types'; export const TabBarCustomButton: React.FC<TabBarCustomButtonProps> = props => { const { children, onPress } = props; return ( <TouchableOpacity style={styles.r...
mikita-kandratsyeu/crypto-wallet-app
src/App.tsx
<reponame>mikita-kandratsyeu/crypto-wallet-app import React from 'react'; import { createStackNavigator } from '@react-navigation/stack'; import { NavigationContainer } from '@react-navigation/native'; import { createStore, applyMiddleware } from 'redux'; import { composeWithDevTools } from 'redux-devtools-extension'; ...
mikita-kandratsyeu/crypto-wallet-app
src/components/Switcher.tsx
import React, { useEffect, useRef, useState } from 'react'; import { Animated, StyleSheet, Text, View } from 'react-native'; import { TouchableOpacity } from 'react-native-gesture-handler'; import { colors, constants, fonts, sizes } from '../constants'; import { MarketTab } from '../constants/constants'; import { Switc...
mikita-kandratsyeu/crypto-wallet-app
src/store/root-reducer.ts
<reponame>mikita-kandratsyeu/crypto-wallet-app import { combineReducers } from 'redux'; import tabReducer from './tab/tab.reducer'; import marketReducer from './market/market.reducer'; export default combineReducers({ tabReducer, marketReducer, });
mikita-kandratsyeu/crypto-wallet-app
src/components/index.ts
<reponame>mikita-kandratsyeu/crypto-wallet-app<filename>src/components/index.ts import { TabIcon } from './TabIcon'; import { TabBarCustomButton } from './TabBarCustomButton'; import { Icon } from './Icon'; import { IconTextButton } from './IconTextButton'; import { BalanceInfo } from './BalanceInfo'; import { Chart } ...
mikita-kandratsyeu/crypto-wallet-app
src/navigation/Tabs.tsx
<filename>src/navigation/Tabs.tsx<gh_stars>0 import React, { useEffect, useMemo, useRef } from 'react'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { connect } from 'react-redux'; import { StyleSheet, Animated } from 'react-native'; import DeviceInfo from 'react-native-device-info';...
mikita-kandratsyeu/crypto-wallet-app
src/components/IconTextButton.tsx
<reponame>mikita-kandratsyeu/crypto-wallet-app<gh_stars>0 import React from 'react'; import { StyleSheet, Text, TouchableHighlight } from 'react-native'; import { Icon } from '.'; import { colors, fonts, sizes } from '../constants'; import { IconTextButtonProps } from './types'; export const IconTextButton: React.FC<I...
mikita-kandratsyeu/crypto-wallet-app
src/screens/MainLayoutWrapper.tsx
import React, { useEffect, useRef } from 'react'; import { StyleSheet, Animated, SafeAreaView, StatusBar, TouchableOpacity, } from 'react-native'; import { connect } from 'react-redux'; import DeviceInfo from 'react-native-device-info'; import { IconTextButton } from '../components'; import { colors, messages...
mikita-kandratsyeu/crypto-wallet-app
src/components/Chart.tsx
<filename>src/components/Chart.tsx import React from 'react'; import { View, StyleSheet, Text } from 'react-native'; import { ChartDot, ChartPath, ChartPathProvider, ChartXLabel, ChartYLabel, monotoneCubicInterpolation, // @ts-ignore } from '@rainbow-me/animated-charts'; import moment from 'moment'; impor...
mikita-kandratsyeu/crypto-wallet-app
src/components/BalanceInfo.tsx
<reponame>mikita-kandratsyeu/crypto-wallet-app import React, { useMemo } from 'react'; import { StyleSheet, View, Text } from 'react-native'; // @ts-ignore import AnimateNumber from 'react-native-countup'; import { Icon } from '.'; import { colors, fonts, messages, sizes } from '../constants'; import { BalanceInfoProps...
mikita-kandratsyeu/crypto-wallet-app
src/constants/theme.ts
import { Dimensions } from 'react-native'; const { width, height } = Dimensions.get('window'); export const colors = { primary: '#1E1E1E', secondary: '#3B3B3B', white: '#fff', lightGreen: '#4BEE70', red: '#D84035', black: '#000000', gray: '#212125', gray1: '#1f1f1f', lightGray: '#3B3B3B', lightGra...
mikita-kandratsyeu/crypto-wallet-app
src/constants/index.ts
import constants from './constants'; import dummyData from './dummy'; import theme, { colors, sizes, fonts } from './theme'; import messages from './messages'; import stackRoutes from './routes'; export { constants, dummyData, theme, colors, sizes, fonts, messages, stackRoutes, };
mikita-kandratsyeu/crypto-wallet-app
src/constants/dummy.ts
<gh_stars>0 export interface Holdings { id: string; qty: number; } export interface Profile { id: number; email: string; } export interface Settings { launchScreen: string; currency: string; appearance: string; language: string; faceId: boolean; } export const holdings: Holdings[] = [ { id: '...
mikita-kandratsyeu/crypto-wallet-app
src/screens/types.ts
<filename>src/screens/types.ts<gh_stars>0 export interface HomeProps { myHoldings: any[]; coins: any[]; getHoldings: any; getCoinMarket: any; } export interface MainLayoutProps { children: React.ReactNode; isTradeModalVisible?: boolean; setTradeModalVisibility?: (isVisible: boolean) => any; } export int...
mikita-kandratsyeu/crypto-wallet-app
src/components/TabIcon.tsx
import React, { useMemo } from 'react'; import { StyleSheet, View, Text } from 'react-native'; import { Icon } from '.'; import { fonts, colors } from '../constants'; import { TabIconProps } from './types'; export const TabIcon: React.FC<TabIconProps> = props => { const { focused, icon, label, isTrade } = props; ...
mikita-kandratsyeu/crypto-wallet-app
src/screens/Home.tsx
<reponame>mikita-kandratsyeu/crypto-wallet-app import React, { useCallback, useState } from 'react'; import { connect } from 'react-redux'; import { View, StyleSheet, FlatList, Text, TouchableOpacity, Image, } from 'react-native'; // @ts-ignore import AnimateNumber from 'react-native-countup'; import { useF...
mikita-kandratsyeu/crypto-wallet-app
src/navigation/index.ts
import Tabs from './Tabs'; export { Tabs };
KashiPrg/PDF_LineBreaks_Remover
src/app.ts
<reponame>KashiPrg/PDF_LineBreaks_Remover<gh_stars>0 // 拡張機能がインストールされたときに右クリックメニューを追加 chrome.runtime.onInstalled.addListener((): void => { chrome.contextMenus.create({ id: "convert_line_breaks_menu", title: chrome.i18n.getMessage("conMenuCopiedTextLineBreaksRemove"), contexts: ["all"], ...
Otto-Health/opentok-network-test-js
src/util/index.ts
/** * @module Util */ /** * Returns a copy of an object, setting or overriding the property with the provided value */ export const assoc = (key: string, value: any, obj: Object): Object => ({ ...obj, [key]: value }); /** * Returns a copy of an object, setting or overriding the property at the specified path ...
Otto-Health/opentok-network-test-js
src/NetworkTest/testQuality/helpers/MOSState.ts
<reponame>Otto-Health/opentok-network-test-js export default class MOSState { statsLog: OT.SubscriberStats[]; audioScoresLog: number[]; videoScoresLog: number[]; stats: HasAudioVideo<AverageStats> = { audio: {}, video: {} }; bandwidth: Bandwidth = { audio: 0, video: 0 }; intervalId?: number; constructor(...
Otto-Health/opentok-network-test-js
src/NetworkTest/errors/types.ts
<filename>src/NetworkTest/errors/types.ts /** * @module Errors/Connectivity/OpenTok */ /** * Define errors returned by OpenTok.js */ import { get } from '../../util'; export enum OTErrorType { JS_EXCEPTION = 'JS_EXCEPTION', AUTHENTICATION_ERROR = 'AUTHENTICATION_ERROR', OT_AUTHENTICATION_ERROR = 'OT_AUTHEN...
Otto-Health/opentok-network-test-js
test/NetworkTest.spec.ts
/* tslint:disable */ ///<reference path="../src/types/index.d.ts"/> import * as OT from '@opentok/client'; import * as Promise from 'promise'; import { primary as sessionCredentials, faultyLogging as badLoggingCredentials, faultyApi as badApiCredentials, } from './credentials.json'; import { NetworkTestError, ...
Otto-Health/opentok-network-test-js
src/NetworkTest/errors/index.ts
<filename>src/NetworkTest/errors/index.ts /** * @module Errors */ /** * Base class for errors used throughout Network Connectivity tests. */ export class NetworkTestError extends Error { constructor(message: string) { super(message); Object.setPrototypeOf(this, NetworkTestError.prototype); this.na...
Otto-Health/opentok-network-test-js
src/types/analytics.d.ts
<gh_stars>0 /** * Analytics */ type Config = { sessionId: string partnerId: string, source: string, clientVersion: string, name: string, componentId: string, } type SessionInfo = { sessionId: string, connectionId: string, partnerId: string }; type LogEvent = { action: string, variation: strin...
Otto-Health/opentok-network-test-js
src/NetworkTest/testQuality/errors/index.ts
/** * @module Errors/Quality */ /** * Define errors for Connectivity Test */ import { NetworkTestError } from '../../errors'; /** * Base class for errors used throughout Network Quality test. */ export class QualityTestError extends NetworkTestError { constructor(message: string) { super(message); ...
Otto-Health/opentok-network-test-js
src/NetworkTest/index.ts
<filename>src/NetworkTest/index.ts /** * @module NetworkTest */ /** * Define Network Connectivy class */ const version = require('../../package.json').version; import { testConnectivity, ConnectivityTestResults } from './testConnectivity'; import testQuality from './testQuality'; import { IncompleteSessionCredent...
Otto-Health/opentok-network-test-js
src/NetworkTest/testQuality/helpers/getLatestSampleWindow.ts
import config from './config'; import { getOr, last } from '../../../util'; export default function getLatestSampleWindow(stats: OT.SubscriberStats[]): OT.SubscriberStats[] { const mostRecentTimestamp: number = getOr(0, 'timestamp', last(stats)); const oldestAllowedTime: number = mostRecentTimestamp - config.stead...
Otto-Health/opentok-network-test-js
src/NetworkTest/testQuality/helpers/isBitrateSteadyState.ts
<reponame>Otto-Health/opentok-network-test-js<gh_stars>0 import getLatestSampleWindow from './getLatestSampleWindow'; import calculateQualityStats from './calculateQualityStats'; import config from './config'; export default function isBitrateSteadyState(statsList: OT.SubscriberStats[]): boolean { const latestSample...
Otto-Health/opentok-network-test-js
src/NetworkTest/testQuality/index.ts
<filename>src/NetworkTest/testQuality/index.ts /** * @module Test/Publishing * @preferred * * Defines the methods required for the Publishing Test Flow */ /** * Publishing Test Flow */ import * as Promise from 'promise'; import { get, getOr, pick } from '../../util'; import * as e from './errors/'; import { O...
Otto-Health/opentok-network-test-js
src/types/opentok.d.ts
/** * @module Types/OpenTok */ /** * OpenTok Client SDK types */ declare module OT { type Properties = { version: string, buildHash: string, debug: boolean, websiteURL: string, cdnURL: string, loggingURL: string, apiURL: string, supportSSL: boolean, cdnURLSSL: string, lo...
Otto-Health/opentok-network-test-js
src/NetworkTest/testConnectivity/errors/mapping.ts
/** * @module Errors/Connectivity/Mapping */ /** * Map Connectivity Errors to Failure Types */ import { ConnectivityError } from './index'; export enum FailureType { APIConnectivityError = 'api', ConnectToSessionNetworkError = 'api', ConnectToSessionError = 'messaging', MediaDeviceError = 'OpenTok.js',...
Otto-Health/opentok-network-test-js
src/types/index.d.ts
/** * @module Types/NetworkTest */ /** * Define global types */ interface OpenTok { initSession: (partnerId: string, sessionId: string) => OT.Session; initPublisher: (targetElement?: HTMLElement | string, properties?: OT.PublisherProperties, callback?: (error?: OT.OTError) => void) => OT.Publisher; getDevic...
labDAO/applayer-rest-api-hub
src/apps/alphafold/docs.ts
<reponame>labDAO/applayer-rest-api-hub<gh_stars>1-10 const init_date = Date.now() const submitted_at = new Date(init_date).toISOString() const started_at = new Date(init_date + 10000).toISOString() const completed_at = new Date(init_date + 20000).toISOString() const docsData = { application: { name: 'alphafold' ...
labDAO/applayer-rest-api-hub
src/index.ts
import corsify from './corsify' import handleRequest from './handler' addEventListener("fetch", (event) => { event.respondWith( corsify(event.request, handleRequest).catch( (err) => new Response(err.stack, { status: 500 }) ) ) })
labDAO/applayer-rest-api-hub
src/declarations.d.ts
<filename>src/declarations.d.ts declare module 'cloudflare-worker-rest-api'
labDAO/applayer-rest-api-hub
src/apps/alphafold/api.ts
<gh_stars>1-10 import docsData from './docs' export const docs = (_req: any, res: any) => { return res.send(docsData) } export const submit = (_req: any, res: any) => { return res.send(docsData.endpoints['/alphafold/submit'].response_example) } export const status = (req: any, res: any) => { const { jobId } = r...
labDAO/applayer-rest-api-hub
src/corsify.ts
<reponame>labDAO/applayer-rest-api-hub<gh_stars>1-10 // adapted from https://bartsolutions.github.io/2021/10/21/cloud-flare-cors-worker-setup/ const corsHeaders: HeadersInit = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS", "Access-Control-Max-Age": "86400", } func...
labDAO/applayer-rest-api-hub
test/apps/alphafold.test.ts
import handleRequest from '../../src/handler' import makeServiceWorkerEnv from 'service-worker-mock' import docsData from '../../src/apps/alphafold/docs' declare var global: any const setup = () => { Object.assign(global, makeServiceWorkerEnv()) jest.resetModules() } describe('/alphafold', () => { beforeEach(s...
labDAO/applayer-rest-api-hub
src/handler.ts
import App from 'cloudflare-worker-rest-api' import { docs, submit, status } from './apps/alphafold/api' const app = new App('/') app.get('/', (_req: any, res: { send: (arg0: { status: string }) => any }) => { return res.send({ status: 'live' }) }) app.get('/alphafold', docs) app.post('/alphafold/submit', submit) ...
sarahM0/cts
src/common/runtime/helper/sys.ts
<reponame>sarahM0/cts /* eslint no-process-exit: "off" */ /* eslint @typescript-eslint/no-namespace: "off" */ function node() { const { existsSync } = require('fs'); return { type: 'node', existsSync, args: process.argv.slice(2), cwd: process.cwd, exit: process.exit, }; } declare global { ...
sarahM0/cts
src/webgpu/idl/exposed.html.ts
// WPT-specific test checking that WebGPU is available iff isSecureContext. import { assert } from '../../common/util/util.js'; // TODO: Test all WebGPU interfaces. const items = [ globalThis.navigator.gpu, globalThis.GPU, globalThis.GPUAdapter, globalThis.GPUDevice, globalThis.GPUBuffer, globalThis.GPUB...
sarahM0/cts
src/webgpu/api/validation/createSampler.spec.ts
export const description = ` createSampler validation tests. `; import { makeTestGroup } from '../../../common/framework/test_group.js'; import { ValidationTest } from './validation_test.js'; export const g = makeTestGroup(ValidationTest); g.test('lodMinAndMaxClamp') .desc('test different combinations of min and ...
sarahM0/cts
src/webgpu/api/operation/memory_sync/buffer/rw_and_wr.spec.ts
<reponame>sarahM0/cts export const description = ` Memory Synchronization Tests for Buffer: read before write and read after write. - Create a single buffer and initialize it to 0, wait on the fence to ensure the data is initialized. Write a number (say 1) into the buffer via render pass, compute pass, copy or writeBu...
sarahM0/cts
src/stress/queries/resolve.spec.ts
<gh_stars>10-100 export const description = ` Stress tests for query resolution. `; import { makeTestGroup } from '../../common/framework/test_group.js'; import { GPUTest } from '../../webgpu/gpu_test.js'; export const g = makeTestGroup(GPUTest); g.test('many_large_sets') .desc( `Tests a huge number of resolve...
sarahM0/cts
src/common/internal/util.ts
<filename>src/common/internal/util.ts /** * Error without a stack, which can be used to fatally exit from `tool/` scripts with a * user-friendly message (and no confusing stack). */ export class StacklessError extends Error { constructor(message: string) { super(message); this.stack = undefined; } }
sarahM0/cts
src/common/internal/query/validQueryPart.ts
<reponame>sarahM0/cts<filename>src/common/internal/query/validQueryPart.ts /** Applies to group parts, test parts, params keys. */ export const validQueryPart = /^[a-zA-Z0-9_]+$/;
sarahM0/cts
src/common/runtime/helper/options.ts
<gh_stars>10-100 let windowURL: URL | undefined = undefined; function getWindowURL() { if (windowURL === undefined) { windowURL = new URL(window.location.toString()); } return windowURL; } export function optionEnabled( opt: string, searchParams: URLSearchParams = getWindowURL().searchParams ): boolean {...
sarahM0/cts
src/common/internal/stack.ts
// Returns the stack trace of an Error, but without the extra boilerplate at the bottom // (e.g. RunCaseSpecific, processTicksAndRejections, etc.), for logging. export function extractImportantStackTrace(e: Error): string { let stack = e.stack; if (!stack) { return ''; } const redundantMessage = 'Error: ' +...
sarahM0/cts
src/webgpu/api/operation/buffers/map_oom.spec.ts
<gh_stars>10-100 export const description = 'Test out-of-memory conditions creating large mappable/mappedAtCreation buffers.'; import { kUnitCaseParamsBuilder } from '../../../../common/framework/params_builder.js'; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { kBufferUsages } ...
sarahM0/cts
src/webgpu/shader/execution/builtin/any.spec.ts
export const description = ` Execution Tests for the 'any' builtin function `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { GPUTest } from '../../../gpu_test.js'; import { False, True, TypeBool, TypeVec, vec2, vec3, vec4 } from '../../../util/conversion.js'; import { run } from...
sarahM0/cts
src/webgpu/util/unions.ts
/** * Reifies a `GPUExtent3D` into a `Required<GPUExtent3DDict>`. */ export function reifyExtent3D( val: Readonly<GPUExtent3DDict> | Iterable<number> ): Required<GPUExtent3DDict> { // TypeScript doesn't seem to want to narrow the types here properly, so hack around it. if (typeof (val as Iterable<number>)[Symbo...
sarahM0/cts
src/unittests/logger.spec.ts
export const description = ` Unit tests for namespaced logging system. Also serves as a larger test of async test functions, and of the logging system. `; import { SkipTestCase } from '../common/framework/fixture.js'; import { makeTestGroup } from '../common/framework/test_group.js'; import { Logger } from '../common...
sarahM0/cts
src/webgpu/api/operation/render_pipeline/entry_point_name.spec.ts
export const description = ` TODO: - Test some weird but valid values for entry point name (both module and pipeline creation should succeed). - Test using each of many entry points in the module (should succeed). - Test using an entry point with the wrong stage (should fail). `; import { makeTestGroup } from '../.....
sarahM0/cts
src/common/internal/query/compare.ts
import { TestParams } from '../../framework/fixture.js'; import { assert, objectEquals } from '../../util/util.js'; import { paramKeyIsPublic } from '../params_utils.js'; import { TestQuery } from './query.js'; export const enum Ordering { Unordered, StrictSuperset, Equal, StrictSubset, } /** * Compares two...
sarahM0/cts
src/webgpu/api/validation/encoding/programmable/pipeline_bind_group_compat.spec.ts
export const description = ` TODO: - test compatibility between bind groups and pipelines - the binding resource in bindGroups[i].layout is "group-equivalent" (value-equal) to pipelineLayout.bgls[i]. - in the test fn, test once without the dispatch/draw (should always be valid) and once with the dispatch/...
sarahM0/cts
src/webgpu/util/texture/subresource.ts
<filename>src/webgpu/util/texture/subresource.ts /** A range of indices expressed as { begin, count }. */ export interface BeginCountRange { begin: number; count: number; } /* A range of indices, expressed as { begin, end }. */ export interface BeginEndRange { begin: number; end: number; } function endOfRange...
sarahM0/cts
src/webgpu/api/validation/encoding/cmds/debug.spec.ts
export const description = ` API validation test for debug groups and markers Test Coverage: - For each encoder type (GPUCommandEncoder, GPUComputeEncoder, GPURenderPassEncoder, GPURenderBundleEncoder): - Test that all pushDebugGroup must have a corresponding popDebugGroup - Push and pop counts of 0, 1, ...
sarahM0/cts
src/unittests/test_group_test.ts
<filename>src/unittests/test_group_test.ts import { Logger, LogResults } from '../common/internal/logging/logger.js'; import { TestQuerySingleCase } from '../common/internal/query/query.js'; import { IterableTestGroup, TestCaseID } from '../common/internal/test_group.js'; import { objectEquals } from '../common/util/ut...
sarahM0/cts
src/unittests/query_compare.spec.ts
export const description = ` Tests for TestQuery comparison `; import { makeTestGroup } from '../common/framework/test_group.js'; import { compareQueries, Ordering } from '../common/internal/query/compare.js'; import { TestQuery, TestQuerySingleCase, TestQueryMultiFile, TestQueryMultiTest, TestQueryMultiCase...
sarahM0/cts
src/webgpu/api/operation/buffers/map_detach.spec.ts
<reponame>sarahM0/cts export const description = ` Tests that TypedArrays created when mapping a GPUBuffer are detached when the buffer is unmapped or destroyed. `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { GPUConst } from '../../../constants.js'; import { GPUTest } from ...
sarahM0/cts
src/webgpu/api/validation/encoding/cmds/render/draw.spec.ts
<reponame>sarahM0/cts<filename>src/webgpu/api/validation/encoding/cmds/render/draw.spec.ts export const description = ` Here we test the validation for draw functions, mainly the buffer access validation. All four types of draw calls are tested, and test that validation errors do / don't occur for certain call type and...
sarahM0/cts
src/webgpu/util/create_elements.ts
import { Fixture } from '../../common/framework/fixture.js'; import { unreachable } from '../../common/util/util.js'; export const allCanvasTypes = ['onscreen', 'offscreen'] as const; export type canvasTypes = 'onscreen' | 'offscreen'; /** Create HTMLCanvas/OffscreenCanvas. */ export function createCanvas( test: Fi...
sarahM0/cts
src/webgpu/shader/validation/shader_io/invariant.spec.ts
<reponame>sarahM0/cts export const description = `Validation tests for the invariant attribute`; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { ShaderValidationTest } from '../shader_validation_test.js'; import { kBuiltins } from './builtins.spec.js'; import { generateShader } fr...
sarahM0/cts
src/unittests/conversion.spec.ts
export const description = `Unit tests for conversion`; import { makeTestGroup } from '../common/internal/test_group.js'; import { float16BitsToFloat32, float32ToFloat16Bits } from '../webgpu/util/conversion.js'; import { UnitTest } from './unit_test.js'; export const g = makeTestGroup(UnitTest); const cases = [ ...
sarahM0/cts
src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts
<gh_stars>10-100 export const description = ` TODO: - for sampleCount = { 1, 4 } and various combinations of: - rasterization mask = { 0, 1, 2, 3, 15 } - sample mask = { 0, 1, 2, 3, 15, 30 } - fragment shader output mask (SV_Coverage) = { 0, 1, 2, 3, 15, 30 } - test that final sample mask is the logical AND...
sarahM0/cts
src/webgpu/shader/validation/shader_validation_test.ts
<reponame>sarahM0/cts<filename>src/webgpu/shader/validation/shader_validation_test.ts<gh_stars>10-100 import { ErrorWithExtra } from '../../../common/util/util.js'; import { GPUTest } from '../../gpu_test.js'; /** * Base fixture for WGSL shader validation tests. */ export class ShaderValidationTest extends GPUTest {...
sarahM0/cts
src/common/tools/version.ts
export const version = require('child_process') .execSync('git describe --always --abbrev=0 --dirty') .toString() .trim();
sarahM0/cts
src/webgpu/api/operation/render_pipeline/pipeline_output_targets.spec.ts
export const description = ` - Test pipeline outputs with different color target formats. `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { unreachable } from '../../../../common/util/util.js'; import { kRenderableColorTextureFormats, kTextureFormatInfo } from '../../../capability...
sarahM0/cts
src/webgpu/web_platform/reftests/gpu_ref_test.ts
<gh_stars>10-100 import { assert } from '../../../common/util/util.js'; declare function takeScreenshotDelayed(ms: number): void; interface GPURefTest { readonly device: GPUDevice; readonly queue: GPUQueue; } export async function runRefTest(fn: (t: GPURefTest) => Promise<void>): Promise<void> { assert( ty...
sarahM0/cts
src/webgpu/web_platform/canvas/configure.spec.ts
export const description = ` Tests for GPUCanvasContext.configure. TODO: Test all options of configure. `; import { Fixture } from '../../../common/framework/fixture.js'; import { makeTestGroup } from '../../../common/framework/test_group.js'; export const g = makeTestGroup(Fixture);
sarahM0/cts
src/webgpu/api/validation/queue/destroyed/texture.spec.ts
<gh_stars>10-100 export const description = ` Tests using a destroyed texture on a queue. - used in {writeTexture, setBindGroup, copyT2T {src,dst}, copyB2T, copyT2B, copyExternalImageToTexture, color attachment {0,>0}, {D,S,DS} attachment, ..?} - x= if applicable, {in pass, in bundle} - x= {destroyed, not destroye...
sarahM0/cts
src/webgpu/shader/validation/shader_io/locations.spec.ts
<reponame>sarahM0/cts<gh_stars>10-100 export const description = `Validation tests for entry point user-defined IO`; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { ShaderValidationTest } from '../shader_validation_test.js'; import { generateShader } from './util.js'; export cons...
sarahM0/cts
src/webgpu/api/operation/command_buffer/render/state_tracking.spec.ts
<filename>src/webgpu/api/operation/command_buffer/render/state_tracking.spec.ts<gh_stars>10-100 export const description = ` Ensure state is set correctly. Tries to stress state caching (setting different states multiple times in different orders) for setIndexBuffer and setVertexBuffer. Equivalent tests for setBindGrou...
sarahM0/cts
src/webgpu/api/validation/buffer/mapping.spec.ts
<filename>src/webgpu/api/validation/buffer/mapping.spec.ts export const description = ` Validation tests for GPUBuffer.mapAsync, GPUBuffer.unmap and GPUBuffer.getMappedRange. `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { attemptGarbageCollection } from '../../../../common/util...
sarahM0/cts
src/unittests/unit_test.ts
<filename>src/unittests/unit_test.ts import { Fixture } from '../common/framework/fixture.js'; export class UnitTest extends Fixture {}
sarahM0/cts
src/demo/json.spec.ts
<filename>src/demo/json.spec.ts export const description = 'Description for a.spec.ts'; import { makeTestGroup } from '../common/framework/test_group.js'; import { UnitTest } from '../unittests/unit_test.js'; export const g = makeTestGroup(UnitTest); g.test('json') .paramsSimple([{ p: { x: 1, y: 'two' } }]) .fn(...
sarahM0/cts
src/webgpu/api/validation/encoding/cmds/render/setPipeline.spec.ts
export const description = ` Validation tests for setPipeline on render pass and render bundle. `; import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; import { kRenderEncodeTypes } from '../../../../../util/command_buffer_maker.js'; import { ValidationTest } from '../../../validation_test...
sarahM0/cts
src/webgpu/util/math.ts
<reponame>sarahM0/cts import { assert } from '../../common/util/util.js'; import { kBit } from '../shader/execution/builtin/builtin.js'; import { f32Bits, Scalar } from './conversion.js'; /** * A multiple of 8 guaranteed to be way too large to allocate (just under 8 pebibytes). * This is a "safe" integer (ULP <= 1....
sarahM0/cts
src/webgpu/api/operation/vertex_state/basic.spec.ts
export const description = ` - Baseline tests checking vertex/instance IDs, with: - No vertexState at all (i.e. no vertex buffers) - One vertex buffer with no attributes `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { GPUTest } from '../../../gpu_test.js'; export const ...
sarahM0/cts
src/webgpu/web_platform/canvas/getPreferredFormat.spec.ts
<filename>src/webgpu/web_platform/canvas/getPreferredFormat.spec.ts export const description = ` Tests for GPUCanvasContext.getPreferredFormat. `; import { Fixture } from '../../../common/framework/fixture.js'; import { makeTestGroup } from '../../../common/framework/test_group.js'; export const g = makeTestGroup(Fix...
sarahM0/cts
src/webgpu/api/operation/sampling/lod_clamp.spec.ts
export const description = ` Tests the behavior of LOD clamping (lodMinClamp, lodMaxClamp). TODO: - Write a test that can test the exact clamping behavior - Test a bunch of values, including very large/small ones. `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { GPUTest } from '...
sarahM0/cts
src/webgpu/api/validation/create_pipeline.spec.ts
export const description = ` TODO: For {createRenderPipeline, createComputePipeline}, start with a valid descriptor (control case), then for each stage {{vertex, fragment}, compute}, make exactly one of the following errors: - one stage's module is an invalid object - one stage's entryPoint doesn't exist - {differen...
sarahM0/cts
src/webgpu/api/operation/buffers/map.spec.ts
export const description = ` Test the operation of buffer mapping, specifically the data contents written via map-write/mappedAtCreation, and the contents of buffers returned by getMappedRange on buffers which are mapped-read/mapped-write/mappedAtCreation. range: used for getMappedRange mapRegion: used for mapAsync m...
sarahM0/cts
src/webgpu/api/validation/encoding/cmds/render/render.ts
import { kUnitCaseParamsBuilder } from '../../../../../../common/framework/params_builder.js'; import { kRenderEncodeTypes } from '../../../../../util/command_buffer_maker.js'; export const kRenderEncodeTypeParams = kUnitCaseParamsBuilder.combine( 'encoderType', kRenderEncodeTypes ); export function buildBufferOf...
sarahM0/cts
src/webgpu/shader/execution/robust_access_vertex.spec.ts
export const description = ` Test vertex attributes behave correctly (no crash / data leak) when accessed out of bounds Test coverage: The following is parameterized (all combinations tested): 1) Draw call type? (drawIndexed, drawIndirect, drawIndexedIndirect) - Run the draw call using an index buffer and/or an in...
sarahM0/cts
src/common/tools/checklist.ts
<reponame>sarahM0/cts import * as fs from 'fs'; import * as process from 'process'; import { DefaultTestFileLoader } from '../internal/file_loader.js'; import { Ordering, compareQueries } from '../internal/query/compare.js'; import { parseQuery } from '../internal/query/parseQuery.js'; import { TestQuery, TestQueryMul...
sarahM0/cts
src/webgpu/api/validation/createBindGroupLayout.spec.ts
export const description = ` createBindGroupLayout validation tests. TODO: make sure tests are complete. `; import { kUnitCaseParamsBuilder } from '../../../common/framework/params_builder.js'; import { makeTestGroup } from '../../../common/framework/test_group.js'; import { kMaxBindingsPerBindGroup, kShaderStage...
sarahM0/cts
src/common/internal/version.ts
<filename>src/common/internal/version.ts export const version = 'unknown';
sarahM0/cts
src/webgpu/shader/execution/builtin/float_built_functions.spec.ts
<filename>src/webgpu/shader/execution/builtin/float_built_functions.spec.ts<gh_stars>10-100 export const description = `WGSL execution test. Section: Float built-in functions`; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { GPUTest } from '../../../gpu_test.js'; export const g = ...
sarahM0/cts
src/webgpu/api/validation/image_copy/layout_related.spec.ts
export const description = ''; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { assert } from '../../../../common/util/util.js'; import { kTextureFormatInfo, kSizedTextureFormats } from '../../../capability_info.js'; import { align } from '../../../util/math.js'; import { bytesInA...
sarahM0/cts
src/webgpu/api/operation/command_buffer/clearBuffer.spec.ts
export const description = ` API operations tests for clearBuffer. `; import { makeTestGroup } from '../../../../common/framework/test_group.js'; import { GPUTest } from '../../../gpu_test.js'; export const g = makeTestGroup(GPUTest); g.test('clear') .desc( `Validate the correctness of the clear by filling the...
sarahM0/cts
src/webgpu/api/validation/resource_usages/texture/in_render_common.spec.ts
export const description = ` TODO: - 2 views: - x= {upon the same subresource, or different subresources {mip level, array layer, aspect} of the same texture} - x= possible binding types on each view: read = {sampled texture, readonly storage texture}, write = {storage texture, render target} - x= different...
sarahM0/cts
src/webgpu/api/validation/render_pass/storeOp.spec.ts
<gh_stars>10-100 export const description = ` API Validation Tests for RenderPass StoreOp. Test Coverage: - Tests that when depthReadOnly is true, depthStoreOp must be 'store'. - When depthReadOnly is true and depthStoreOp is 'discard', an error should be generated. - Tests that when stencilReadOnly is true, ...
sarahM0/cts
src/common/internal/query/separators.ts
<filename>src/common/internal/query/separators.ts /** Separator between big parts: suite:file:test:case */ export const kBigSeparator = ':'; /** Separator between path,to,file or path,to,test */ export const kPathSeparator = ','; /** Separator between k=v;k=v */ export const kParamSeparator = ';'; /** Separator betw...
sarahM0/cts
src/webgpu/api/operation/memory_sync/texture/rw_and_wr.spec.ts
export const description = ` Memory Synchronization Tests for Texture: read before write and read after write. TODO `; import { makeTestGroup } from '../../../../../common/framework/test_group.js'; import { GPUTest } from '../../../../gpu_test.js'; export const g = makeTestGroup(GPUTest);