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

Side by Side Diff: LayoutTests/http/tests/inspector/elements-test.js

Issue 257873002: DevTools: do not use internals for highlight testing, use protocol instead. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/highlight-node.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var initialize_ElementTest = function() { 1 var initialize_ElementTest = function() {
2 2
3 InspectorTest.findNode = function(matchFunction, callback) 3 InspectorTest.findNode = function(matchFunction, callback)
4 { 4 {
5 callback = InspectorTest.safeWrap(callback); 5 callback = InspectorTest.safeWrap(callback);
6 var result = null; 6 var result = null;
7 var pendingRequests = 0; 7 var pendingRequests = 0;
8 function processChildren(node) 8 function processChildren(node)
9 { 9 {
10 try { 10 try {
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 { 728 {
729 // Click "Add new rule". 729 // Click "Add new rule".
730 document.getElementById("add-style-button-test-id").click(); 730 document.getElementById("add-style-button-test-id").click();
731 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2 ]; 731 var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2 ];
732 if (typeof selector === "string") 732 if (typeof selector === "string")
733 section._selectorElement.textContent = selector; 733 section._selectorElement.textContent = selector;
734 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter") ); 734 section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter") );
735 InspectorTest.addSniffer(WebInspector.BlankStylePropertiesSection.prototype, "makeNormal", callback); 735 InspectorTest.addSniffer(WebInspector.BlankStylePropertiesSection.prototype, "makeNormal", callback);
736 } 736 }
737 737
738 InspectorTest.dumpInspectorHighlight = function(node, callback)
739 {
740 node.boxModel(function(boxModel) {
741 var rectNames = ["margin", "border", "padding", "content"];
742 for (var i = 0; i < rectNames.length; i++) {
743 var rect = boxModel[rectNames[i]];
744 InspectorTest.addResult(rectNames[i] + " rect is " + (rect[4] - rect [0]) + " x " + (rect[5] - rect[1]) + " at (" + rect[0] + ", " + rect[1] + ")");
745 }
746 callback();
747 });
748 }
749
738 }; 750 };
739
740 function dumpInspectorHighlightRects()
741 {
742 var rectNames = ["margin", "border", "padding", "content"];
743 var rects = window.internals.inspectorHighlightRects(document);
744 for (var i = 0; i < rects.length; i++)
745 {
746 var rectName = (i < rectNames.length ? rectNames[i] : "untitled");
747 var rect = rects.item(i);
748 output(rectName + " rect is " + rect.width + " x " + rect.height + " at (" + rect.left + ", " + rect.top + ")");
749 }
750 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/elements/highlight-node.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698