Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/page-mock.js

Issue 2769843003: DevTools: split text_utils out of common module (Closed)
Patch Set: rebaseline Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var initialize_EmptyPageMock = function() { 1 var initialize_EmptyPageMock = function() {
2 2
3 var id = 0; 3 var id = 0;
4 4
5 function nextId(prefix) { 5 function nextId(prefix) {
6 return (prefix || '') + (++id); 6 return (prefix || '') + (++id);
7 } 7 }
8 8
9 InspectorTest.connectToPage = function(targetName, pageMock, makeMainTarget) { 9 InspectorTest.connectToPage = function(targetName, pageMock, makeMainTarget) {
10 var mockTarget = SDK.targetManager.createTarget(nextId('mock-target-'), targ etName, pageMock.capabilities(), params => pageMock.createConnection(params)); 10 var mockTarget = SDK.targetManager.createTarget(nextId('mock-target-'), targ etName, pageMock.capabilities(), params => pageMock.createConnection(params));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 var id = nextId(); 64 var id = nextId();
65 content += '\n//# sourceURL=' + url; 65 content += '\n//# sourceURL=' + url;
66 this._scriptContents.set(id, content); 66 this._scriptContents.set(id, content);
67 67
68 var context = this._executionContexts.find(context => context.auxData.is Default !== isContentScript); 68 var context = this._executionContexts.find(context => context.auxData.is Default !== isContentScript);
69 if (!context) { 69 if (!context) {
70 context = this._createExecutionContext(this._mainFrame, isContentScr ipt); 70 context = this._createExecutionContext(this._mainFrame, isContentScr ipt);
71 this._fireEvent('Runtime.executionContextCreated', {context: context }); 71 this._fireEvent('Runtime.executionContextCreated', {context: context });
72 } 72 }
73 73
74 var text = new Common.Text(content); 74 var text = new TextUtils.Text(content);
75 var script = { 75 var script = {
76 scriptId: id, 76 scriptId: id,
77 url: url, 77 url: url,
78 startLine: 0, 78 startLine: 0,
79 startColumn: 0, 79 startColumn: 0,
80 endLine: text.lineCount(), 80 endLine: text.lineCount(),
81 endColumn: text.lineAt(text.lineCount()).length - 1, 81 endColumn: text.lineAt(text.lineCount()).length - 1,
82 executionContextId: context.id, 82 executionContextId: context.id,
83 hash: String.hashCode(content), 83 hash: String.hashCode(content),
84 executionContextAuxData: context.auxData, 84 executionContextAuxData: context.auxData,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 disconnect() { 240 disconnect() {
241 this._onDisconnect.call(null, 'force disconnect'); 241 this._onDisconnect.call(null, 'force disconnect');
242 this._onDisconnect = null; 242 this._onDisconnect = null;
243 this._onMessage = null; 243 this._onMessage = null;
244 return Promise.resolve(); 244 return Promise.resolve();
245 } 245 }
246 }; 246 };
247 247
248 }; 248 };
249 249
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698