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

Side by Side Diff: LayoutTests/inspector/profiler/canvas2d/canvas2d-gradient-capturing.html

Issue 1073863003: DevTools: remove Canvas profiler from DevTools source base. See details in the bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tests gone Created 5 years, 8 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
(Empty)
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../canvas-profiler-test.js"></script>
5 <script>
6
7 var ctx;
8 var rawCtx;
9 var ctxResource;
10
11 function testCanvasGradientCapturing()
12 {
13 var gradient = ctx.createLinearGradient(0, 0, 10, 10);
14 console.assert(gradient, "Failed to create a CanvasGradient object");
15 gradient.addColorStop(0, '#fff');
16 gradient.addColorStop(0.3, '#aaa');
17 gradient.addColorStop(1, '#000');
18
19 var gradientResource = gradient["__resourceObject"];
20 console.assert(gradientResource, "CanvasGradient object is not wrapped");
21
22 var calls = gradientResource.calls();
23 var expectedLength = 4;
24 console.assert(calls.length === expectedLength, "Expected length of the log: " + expectedLength + ", but was: " + calls.length);
25 }
26
27 function createAndRunCanvas2DProgram()
28 {
29 ctx = createCanvas2DContext();
30 console.assert(ctx, "Failed to create 2D context");
31
32 ctxResource = ctx["__resourceObject"];
33 console.assert(ctxResource, "2D context is not wrapped");
34
35 rawCtx = ctxResource.wrappedObject();
36 console.assert(rawCtx, "No raw 2D context found");
37 console.assert(ctx !== rawCtx, "Proxy and RAW contexts should not be the sam e");
38
39 testCanvasGradientCapturing();
40
41 return "SUCCESS";
42 }
43
44 function test()
45 {
46 InspectorTest.enableCanvasAgent(step1);
47 function step1()
48 {
49 InspectorTest.evaluateInPage("createAndRunCanvas2DProgram()", step2);
50 }
51 function step2(error)
52 {
53 InspectorTest.assertEquals("SUCCESS", error.description);
54 InspectorTest.completeTest();
55 }
56 }
57
58 </script>
59 </head>
60 <body onload="runTest()">
61 <p>
62 Tests Canvas 2D capturing for CanvasGradient objects.
63 </p>
64 <a href="https://bugs.webkit.org/show_bug.cgi?id=101432">Bug 101432</a>
65
66 </body>
67 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698