Skip to content

Instantly share code, notes, and snippets.

View burg's full-sized avatar

Blaze Jayne burg

View GitHub Profile
@burg
burg / hideHighlight.html
Created December 11, 2017 21:02
testing with async functions
<!doctype html>
<html>
<head>
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
function test()
{
const color = undefined;
const outlineColor = undefined;
@burg
burg / timeline-frames-filtered-record-bar-click.js
Last active August 24, 2016 23:02
Web Inspector UI Testing Sketches
function test() {
WUI.TabBar.activeTabTypes = [WUI.Tab.Type.Timeline];
let timelineTab = WUI.tabBar.tabForType(WUI.Tab.Type.Timeline);
timelineTab.activeTimelineTypes = [
WUI.Timeline.Type.JavaScript,
];
// Set up local variables and state.
let framesTimeline = timelineTab.timelineForType(WUI.Timeline.Type.RenderingFrames);
let recordToSelect = null;
@burg
burg / foo.js
Created November 13, 2015 19:41
CodeMirror handleKillKey
_handleKillKey(codeMirror)
{
let handleTextChanges = (cm, changes) => {
console.assert(this._expectTextChanges);
this._expectTextChanges = false;
console.log(changes);
console.log("changes OFF, blur ON, move ON");
let killedText;
console.assert(changes.length === 1);
let change = changes[0];
@burg
burg / getProperties_v2.html
Created July 13, 2015 21:03
New promise-based protocol test
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
<script>
function test()
{
InspectorTest.TestRunner = class TestRunner {
constructor() {
this.testcases = [];
}
@burg
burg / performSearch
Last active August 29, 2015 14:23
Using Optional<T>
// ------ Old
void DOMBackendDispatcher::performSearch(long callId, const InspectorObject& message)
{
auto protocolErrors = Inspector::Protocol::Array<String>::create();
RefPtr<InspectorObject> paramsContainer;
message.getObject(ASCIILiteral("params"), paramsContainer);
String in_query = BackendDispatcher::getString(paramsContainer.get(), ASCIILiteral("query"), nullptr, protocolErrors.get());
bool opt_in_nodeIds_valueFound = false;
RefPtr<Inspector::InspectorArray> opt_in_nodeIds = BackendDispatcher::getArray(paramsContainer.get(), ASCIILiteral("nodeIds"), &opt_in_nodeIds_valueFound, protocolErrors.get());
@burg
burg / TestResultHistoryGraphView.js
Created June 9, 2015 21:57
Rendering an interactive graph with d3
render: function()
{
if (this._requestAnimationFrameToken)
this._requestAnimationFrameToken = undefined;
var runs = this._results.runs;
var availWidth = 780;
var padding = 2;
var width = availWidth - 2 * padding;
@burg
burg / series.txt
Created April 20, 2015 16:43
Patch series for scry-staging
1. Refactor CSSAgent to not refcount everything, new wrappers
2. Stub out DOMTracing domain, agent, manager
3. Capture/compare/commit snapshots on backend
4. Capture screenshots, add element tracking timeline (bars), basic screenshot content view
5. Convert to having "subview" of TimelineRecordingContentView w/ own navigation bar
6. Convert to screenshot stacks on the timeline
7. Add popover previews for stacks
8. Move scrollbar of TimelineOverview out of last row
9. Selectable screenshot stacks
10. Show snapshot diff view when two snapshots selected
function processRecord(recordPayload, parentRecordPayload)
{
var startTime = recordPayload.startTime;
var endTime = recordPayload.endTime;
// COMPATIBILITY (iOS8): old versions use milliseconds since the epoch, rather
// than seconds elapsed since timeline capturing started. We approximate the latter by
// subtracting the start timestamp, as old versions did not use monotonic times.
if (isNaN(this._legacyFirstRecordTimestamp))
this._legacyFirstRecordTimestamp = recordPayload.startTime;
@burg
burg / webreplay.md
Last active August 29, 2015 14:06
draft, "The Mechanics of Web Replay"

The Mechanics of Web Replay Brian Burg burg@cs.washington.edu


Web replay is a new technology for low-overhead deterministic replay of web applications. This document explains how the feature is implemented in the WebKit engine, with a focus on the replay infrastructure and how it integrates with other parts of WebKit. (It does not describe the various UI integrations of replay functionality with the WebKit Web Inspector.) It is intended for consumption by other WebKit engineers and browser hackers. Where the text describes planned work or work-in-progress, the relevant Bugzilla bugs are linked.

For more background on the origins and research context of this technology, the reader should see the paper published at UIST 2013: http://homes.cs.washington.edu/~mernst/pubs/record-replay-uist2013.pdf


@burg
burg / gist:6a151fdf9abd7c62f544
Last active August 29, 2015 14:05
Leakless promise API
WebInspector.EventListener = function(thisObject, fireOnce)
{
this._thisObject = thisObject;
this._emitter = null;
this._listener = null;
this._fireOnce = fireOnce;
}
WebInspector.EventListener.prototype = {
connect: function(emitter, type, listener, usesCapture)