-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "ui: move most state from Globals to AppImpl" into main
- Loading branch information
Showing
22 changed files
with
750 additions
and
639 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (C) 2024 The Android Open Source Project | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import {Time} from '../base/time'; | ||
import {AppImpl} from '../core/app_trace_impl'; | ||
import {TraceInfo} from '../public/trace_info'; | ||
import {EngineBase} from '../trace_processor/engine'; | ||
|
||
class FakeEngine extends EngineBase { | ||
id: string = 'TestEngine'; | ||
|
||
rpcSendRequestBytes(_data: Uint8Array) { | ||
throw new Error('FakeEngine.query() should never be reached'); | ||
} | ||
} | ||
|
||
// This is used: | ||
// - For testing. | ||
// - By globals.ts before we have an actual trace loaded, to avoid causing | ||
// if (!= undefined) checks everywhere. | ||
export function createFakeTraceImpl() { | ||
const fakeTraceInfo: TraceInfo = { | ||
source: {type: 'URL', url: ''}, | ||
traceTitle: '', | ||
traceUrl: '', | ||
start: Time.fromSeconds(0), | ||
end: Time.fromSeconds(10), | ||
realtimeOffset: Time.ZERO, | ||
utcOffset: Time.ZERO, | ||
traceTzOffset: Time.ZERO, | ||
cpus: [], | ||
gpuCount: 0, | ||
}; | ||
return AppImpl.instance.newTraceInstance(new FakeEngine(), fakeTraceInfo); | ||
} |
Oops, something went wrong.