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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html

Issue 2889013002: DevTools: introduce uiSourceCode.mimeType() method (Closed)
Patch Set: address comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html
index 6f7de772bdc5b1ad709e4a4b10f86cb930b41c26..edca111330ef9d7473d4465c5443438887fd8809 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/ui-source-code.html
@@ -6,15 +6,28 @@
function test()
{
- var MockProject = function() {}
- MockProject.prototype.requestFileContent = function(uri, callback)
- {
- InspectorTest.addResult("Content is requested from SourceCodeProvider.");
- setTimeout(callback.bind(null, "var x = 0;"), 0);
- }
- MockProject.prototype.isServiceProject = function() { return false; };
- MockProject.prototype.type = function() { return Workspace.projectTypes.Debugger; }
- MockProject.prototype.url = function() { return "mock://debugger-ui/"; }
+ var MockProject = class extends Workspace.ProjectStore {
+ requestFileContent(uri, callback) {
+ InspectorTest.addResult("Content is requested from SourceCodeProvider.");
+ setTimeout(callback.bind(null, "var x = 0;"), 0);
+ }
+
+ mimeType() {
+ return 'text/javascript';
+ }
+
+ isServiceProject() {
+ return false;
+ }
+
+ type() {
+ return Workspace.projectTypes.Debugger;
+ }
+
+ url() {
+ return "mock://debugger-ui/";
+ }
+ };
InspectorTest.runTestSuite([
function testUISourceCode(next)
@@ -23,14 +36,14 @@ function test()
function didRequestContent(callNumber, content)
{
InspectorTest.addResult("Callback " + callNumber + " is invoked.");
- InspectorTest.assertEquals("text/javascript", Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode));
+ InspectorTest.assertEquals("text/javascript", uiSourceCode.mimeType());
InspectorTest.assertEquals("var x = 0;", content);
if (callNumber === 3) {
// Check that sourceCodeProvider.requestContent won't be called anymore.
uiSourceCode.requestContent().then(function(content)
{
- InspectorTest.assertEquals("text/javascript", Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode));
+ InspectorTest.assertEquals("text/javascript", uiSourceCode.mimeType());
InspectorTest.assertEquals("var x = 0;", content);
next();
});

Powered by Google App Engine
This is Rietveld 408576698