Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Commit

Permalink
Merging from chrome-devtools, fixing conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Markzipan committed Dec 22, 2018
2 parents 185292a + 33b4091 commit 4b598e7
Show file tree
Hide file tree
Showing 357 changed files with 44,773 additions and 48,667 deletions.
156 changes: 138 additions & 18 deletions BUILD.gn

Large diffs are not rendered by default.

Binary file removed front_end/Images/accelerometer-back.png
Binary file not shown.
69 changes: 69 additions & 0 deletions front_end/Images/accelerometer-back.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed front_end/Images/accelerometer-front.png
Binary file not shown.
28 changes: 28 additions & 0 deletions front_end/Images/accelerometer-front.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed front_end/Images/deleteIcon.png
Binary file not shown.
Binary file modified front_end/Images/whatsnew.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions front_end/OWNERS.chromium
@@ -1,5 +1,7 @@
alph@chromium.org
caseq@chromium.org
dgozman@chromium.org
einbinder@chromium.org
luoe@chromium.org
lushnikov@chromium.org
pfeldman@chromium.org
42 changes: 13 additions & 29 deletions front_end/Runtime.js
Expand Up @@ -66,8 +66,6 @@ var Runtime = class { // eslint-disable-line

for (let i = 0; i < descriptors.length; ++i)
this._registerModule(descriptors[i]);

Runtime._runtimeReadyPromiseCallback();
}

/**
Expand Down Expand Up @@ -237,8 +235,8 @@ var Runtime = class { // eslint-disable-line
/**
* @return {!Promise}
*/
static async runtimeReady() {
return Runtime._runtimeReadyPromise;
static async appStarted() {
return Runtime._appStartedPromise;
}

/**
Expand Down Expand Up @@ -289,7 +287,8 @@ var Runtime = class { // eslint-disable-line
}
self.runtime = new Runtime(moduleDescriptors);
if (coreModuleNames)
return /** @type {!Promise<undefined>} */ (self.runtime._loadAutoStartModules(coreModuleNames));
await self.runtime._loadAutoStartModules(coreModuleNames);
Runtime._appStartedPromiseCallback();
}

/**
Expand All @@ -309,7 +308,7 @@ var Runtime = class { // eslint-disable-line
* @return {?string}
*/
static queryParam(name) {
return Runtime._queryParamsObject[name] || null;
return Runtime._queryParamsObject.get(name);
}

/**
Expand Down Expand Up @@ -564,12 +563,8 @@ var Runtime = class { // eslint-disable-line
}
};

/**
* @type {!Object.<string, string>}
*/
Runtime._queryParamsObject = {
__proto__: null
};
/** @type {!URLSearchParams} */
Runtime._queryParamsObject = new URLSearchParams(Runtime.queryParamsString());

Runtime._instanceSymbol = Symbol('instance');

Expand Down Expand Up @@ -971,7 +966,10 @@ Runtime.ExperimentsSupport = class {
*/
isEnabled(experimentName) {
this._checkExperiment(experimentName);

// Check for explicitly disabled experiments first - the code could call setEnable(false) on the experiment enabled
// by default and we should respect that.
if (Runtime._experimentsSetting()[experimentName] === false)
return false;
if (this._enabledTransiently[experimentName])
return true;
if (!this.supportEnabled())
Expand Down Expand Up @@ -1066,26 +1064,12 @@ Runtime.Experiment = class {
}
};

{
(function parseQueryParameters() {
const queryParams = Runtime.queryParamsString();
if (!queryParams)
return;
const params = queryParams.substring(1).split('&');
for (let i = 0; i < params.length; ++i) {
const pair = params[i].split('=');
const name = pair.shift();
Runtime._queryParamsObject[name] = pair.join('=');
}
})();
}

// This must be constructed after the query parameters have been parsed.
Runtime.experiments = new Runtime.ExperimentsSupport();

/** @type {Function} */
Runtime._runtimeReadyPromiseCallback;
Runtime._runtimeReadyPromise = new Promise(fulfil => Runtime._runtimeReadyPromiseCallback = fulfil);
Runtime._appStartedPromiseCallback;
Runtime._appStartedPromise = new Promise(fulfil => Runtime._appStartedPromiseCallback = fulfil);
/**
* @type {?string}
*/
Expand Down
25 changes: 21 additions & 4 deletions front_end/Tests.js
Expand Up @@ -565,7 +565,7 @@
this._waitForTargets(2, callback.bind(this));

function callback() {
Protocol.InspectorBackend.deprecatedRunAfterPendingDispatches(this.releaseControl.bind(this));
Protocol.test.deprecatedRunAfterPendingDispatches(this.releaseControl.bind(this));
}
};

Expand All @@ -576,13 +576,30 @@
function callback() {
const debuggerModel = SDK.targetManager.models(SDK.DebuggerModel)[0];
if (debuggerModel.isPaused()) {
this.releaseControl();
SDK.consoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, onConsoleMessage, this);
debuggerModel.resume();
return;
}
this._waitForScriptPause(this.releaseControl.bind(this));
this._waitForScriptPause(callback.bind(this));
}

function onConsoleMessage(event) {
const message = event.data.messageText;
if (message !== 'connected')
this.fail('Unexpected message: ' + message);
this.releaseControl();
}
};

TestSuite.prototype.testSharedWorkerNetworkPanel = function() {
this.takeControl();
this.showPanel('network').then(() => {
if (!document.querySelector('#network-container'))
this.fail('unable to find #network-container');
this.releaseControl();
});
};

TestSuite.prototype.enableTouchEmulation = function() {
const deviceModeModel = new Emulation.DeviceModeModel(function() {});
deviceModeModel._target = SDK.targetManager.mainTarget();
Expand Down Expand Up @@ -1161,7 +1178,7 @@
browserContextIds.push(browserContextId);

const {targetId} = await targetAgent.invoke_createTarget({url: 'about:blank', browserContextId});
await targetAgent.invoke_attachToTarget({targetId});
await targetAgent.invoke_attachToTarget({targetId, flatten: true});

const target = SDK.targetManager.targets().find(target => target.id() === targetId);
const pageAgent = target.pageAgent();
Expand Down
4 changes: 3 additions & 1 deletion front_end/accessibility/AccessibilityNodeView.js
Expand Up @@ -507,7 +507,9 @@ Accessibility.AXRelatedNodeElement = class {
if (this._deferredNode) {
valueElement = createElement('span');
element.appendChild(valueElement);
Common.Linkifier.linkify(this._deferredNode).then(linkfied => valueElement.appendChild(linkfied));
this._deferredNode.resolvePromise().then(node => {
Common.Linkifier.linkify(node).then(linkfied => valueElement.appendChild(linkfied));
});
} else if (this._idref) {
element.classList.add('invalid');
valueElement = Accessibility.AXNodePropertyTreeElement.createExclamationMark(ls`No node with this ID.`);
Expand Down
4 changes: 4 additions & 0 deletions front_end/accessibility/AccessibilityStrings.js
Expand Up @@ -14,6 +14,10 @@ Accessibility.AccessibilityStrings.AXAttributes = {
description: 'If true, this element\'s user-entered value does not conform to validation requirement.',
group: 'AXGlobalStates'
},
'editable': {name: 'Editable', description: 'If and how this element can be edited.'},
'focusable': {name: 'Focusable', description: 'If true, this element can recieve focus.'},
'focused': {name: 'Focused', description: 'If true, this element currently has focus.'},
'settable': {name: 'Can set value', description: 'Whether the value of this element can be set.'},
'live': {
name: 'Live region',
description: 'Whether and what priority of live updates may be expected for this element.',
Expand Down
2 changes: 1 addition & 1 deletion front_end/animation/animationTimeline.css
Expand Up @@ -97,7 +97,7 @@ circle.animation-keyframe-point {
display: flex;
background-color: var(--toolbar-bg-color);
border-bottom: var(--divider-border);
flex: 0 0;
flex: 0 0 auto;
}

.animation-timeline-toolbar {
Expand Down
63 changes: 44 additions & 19 deletions front_end/application_test_runner/CacheStorageTestRunner.js
Expand Up @@ -7,17 +7,33 @@
* @suppress {accessControls}
*/

ApplicationTestRunner.dumpCacheTree = async function() {
ApplicationTestRunner.dumpCacheTree = async function(pathFilter) {
UI.panels.resources._sidebar.cacheStorageListTreeElement.expand();
const promise = TestRunner.addSnifferPromise(SDK.ServiceWorkerCacheModel.prototype, '_updateCacheNames');
UI.panels.resources._sidebar.cacheStorageListTreeElement._refreshCaches();
await promise;
await ApplicationTestRunner.dumpCacheTreeNoRefresh();
await ApplicationTestRunner.dumpCacheTreeNoRefresh(pathFilter);
};

ApplicationTestRunner.dumpCacheTreeNoRefresh = async function() {
ApplicationTestRunner.dumpCacheTreeNoRefresh = async function(pathFilter) {
function _dumpDataGrid(dataGrid, indentSpaces) {
for (const node of dataGrid.rootNode().children) {
const children = Array.from(node.element().children).filter(function(element) {
return !element.classList.contains('responseTime-column');
});

const entries = Array.from(children, td => td.textContent).filter(text => text);
TestRunner.addResult(' '.repeat(8) + entries.join(', '));
}
}

UI.panels.resources._sidebar.cacheStorageListTreeElement.expand();
TestRunner.addResult('Dumping CacheStorage tree:');

if (!pathFilter)
TestRunner.addResult('Dumping CacheStorage tree:');
else
TestRunner.addResult('Dumping CacheStorage tree with URL path filter string "' + pathFilter + '"');

const cachesTreeElement = UI.panels.resources._sidebar.cacheStorageListTreeElement;

if (!cachesTreeElement.childCount()) {
Expand All @@ -29,31 +45,29 @@ ApplicationTestRunner.dumpCacheTreeNoRefresh = async function() {
const cacheTreeElement = cachesTreeElement.childAt(i);
TestRunner.addResult(' cache: ' + cacheTreeElement.title);
let view = cacheTreeElement._view;
promise = TestRunner.addSnifferPromise(Resources.ServiceWorkerCacheView.prototype, '_updateDataCallback');

if (!view)
cacheTreeElement.onselect(false);
else
view._updateData(true);

view = cacheTreeElement._view;
await promise;

if (view._entriesForTest.length === 0) {
await view._updateData(true);
if (cacheTreeElement._view._entriesForTest.length === 0) {
TestRunner.addResult(' (cache empty)');
continue;
}

const dataGrid = view._dataGrid;

for (const node of dataGrid.rootNode().children) {
const children = Array.from(node.element().children).filter(function(element) {
return !element.classList.contains('responseTime-column');
});
if (!pathFilter) {
_dumpDataGrid(view._dataGrid);
continue;
}

const entries = Array.from(children, td => td.textContent).filter(text => text);
TestRunner.addResult(' ' + entries.join(', '));
cacheTreeElement._view._entryPathFilter = pathFilter;
await view._updateData(true);
if (cacheTreeElement._view._entriesForTest.length === 0) {
TestRunner.addResult(' (no matching entries)');
continue;
}

_dumpDataGrid(cacheTreeElement._view._dataGrid);
}
};

Expand Down Expand Up @@ -123,6 +137,10 @@ ApplicationTestRunner.addCacheEntry = function(cacheName, requestUrl, responseTe
return TestRunner.callFunctionInPageAsync('addCacheEntry', [cacheName, requestUrl, responseText]);
};

ApplicationTestRunner.addCacheEntryWithNoCorsRequest = function(cacheName, requestUrl) {
return TestRunner.callFunctionInPageAsync('addCacheEntryWithNoCorsRequest', [cacheName, requestUrl]);
};

ApplicationTestRunner.deleteCache = function(cacheName) {
return TestRunner.callFunctionInPageAsync('deleteCache', [cacheName]);
};
Expand Down Expand Up @@ -159,6 +177,13 @@ TestRunner.deprecatedInitAsync(`
}).catch(onCacheStorageError);
}
function addCacheEntryWithNoCorsRequest(cacheName, requestUrl) {
return caches.open(cacheName).then(async function(cache) {
let request = new Request(requestUrl, {mode: 'no-cors'});
return cache.put(request, await fetch(request));
}).catch(onCacheStorageError);
}
function deleteCache(cacheName) {
return caches.delete(cacheName).then(function(success) {
if (!success)
Expand Down

0 comments on commit 4b598e7

Please sign in to comment.