diff options
author | jbroman <jbroman@chromium.org> | 2016-02-18 08:55:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-18 16:57:07 +0000 |
commit | 55f9999801dbde105cc8276cf81fe7ffa5b04291 (patch) | |
tree | 15a4dc23e62915c0ab3fe7c889f228c0c0c71956 | |
parent | 7768f7921b58b662eae42803534c3efa9a88c1a7 (diff) | |
download | chromium_src-55f9999801dbde105cc8276cf81fe7ffa5b04291.zip chromium_src-55f9999801dbde105cc8276cf81fe7ffa5b04291.tar.gz chromium_src-55f9999801dbde105cc8276cf81fe7ffa5b04291.tar.bz2 |
Remove Core Animation drawing model support from the test plugin.
We no longer support NPAPI, so tests for the NPAPI Core Animation drawing model
are unnecessary. Removing them trims down the list of tests that fail with
Slimming Paint v2, which doesn't support this at present.
BUG=563667
Review URL: https://codereview.chromium.org/1709703003
Cr-Commit-Position: refs/heads/master@{#376181}
20 files changed, 2 insertions, 357 deletions
diff --git a/content/content_shell.gypi b/content/content_shell.gypi index 70dc03f..43b456d 100644 --- a/content/content_shell.gypi +++ b/content/content_shell.gypi @@ -543,7 +543,6 @@ 'sources': [ 'shell/tools/plugin/PluginObject.cpp', 'shell/tools/plugin/PluginObject.h', - 'shell/tools/plugin/PluginObjectMac.mm', 'shell/tools/plugin/PluginTest.cpp', 'shell/tools/plugin/PluginTest.h', 'shell/tools/plugin/TestObject.cpp', diff --git a/content/shell/tools/plugin/PluginObject.h b/content/shell/tools/plugin/PluginObject.h index 0c037e8..bc904a5 100644 --- a/content/shell/tools/plugin/PluginObject.h +++ b/content/shell/tools/plugin/PluginObject.h @@ -70,9 +70,6 @@ typedef struct { #ifdef XP_MACOSX NPEventModel eventModel; #endif -#ifdef XP_MACOSX - void* coreAnimationLayer; -#endif NPWindow lastWindow; NPBool alwaysFilterEvents; } PluginObject; @@ -94,8 +91,4 @@ extern void pluginLogWithArguments(NPP instance, extern bool testDocumentOpen(NPP npp); extern bool testWindowOpen(NPP npp); -#ifdef XP_MACOSX -extern void* createCoreAnimationLayer(); -#endif - #endif // PluginObject_h diff --git a/content/shell/tools/plugin/PluginObjectMac.mm b/content/shell/tools/plugin/PluginObjectMac.mm deleted file mode 100644 index d69908b..0000000 --- a/content/shell/tools/plugin/PluginObjectMac.mm +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PluginObject.h" - - -#include <QuartzCore/QuartzCore.h> - -@interface TestPluginLayer : CALayer -@end - -@implementation TestPluginLayer - -- (void)drawInContext:(CGContextRef)context -{ - CGRect bounds = [self bounds]; - const char* text = "Test Plugin"; - CGContextSelectFont(context, "Helvetica", 24, kCGEncodingMacRoman); - CGContextShowTextAtPoint(context, - bounds.origin.x + 3.0f, - bounds.origin.y + bounds.size.height - 30.0f, - text, - strlen(text)); -} - -@end - -void* createCoreAnimationLayer() -{ - CALayer *caLayer = [[TestPluginLayer alloc] init]; - - NSNull *nullValue = [NSNull null]; - NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys: - nullValue, @"anchorPoint", - nullValue, @"bounds", - nullValue, @"contents", - nullValue, @"contentsRect", - nullValue, @"opacity", - nullValue, @"position", - nullValue, @"shadowColor", - nullValue, @"sublayerTransform", - nullValue, @"sublayers", - nullValue, @"transform", - nullValue, @"zPosition", - nil]; - // Turn off default animations. - [caLayer - setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]]; - [caLayer setNeedsDisplayOnBoundsChange:YES]; - - [caLayer setBounds:CGRectMake(0, 0, 200, 100)]; - [caLayer setAnchorPoint:CGPointZero]; - - CGColorRef color = CGColorCreateGenericRGB(0.5, 0.5, 1, 1); - [caLayer setBackgroundColor:color]; - CGColorRelease(color); - - [caLayer setLayoutManager:[CAConstraintLayoutManager layoutManager]]; - - CALayer *sublayer = [CALayer layer]; - // Turn off default animations. - [sublayer - setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]]; - - color = CGColorCreateGenericRGB(0, 0, 0, 0.75); - [sublayer setBackgroundColor:color]; - CGColorRelease(color); - [sublayer setBounds:CGRectMake(0, 0, 180, 20)]; - - [sublayer - addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinY - relativeTo:@"superlayer" - attribute:kCAConstraintMinY]]; - [sublayer - addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinX - relativeTo:@"superlayer" - attribute:kCAConstraintMinX]]; - [sublayer - addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxX - relativeTo:@"superlayer" - attribute:kCAConstraintMaxX]]; - - [caLayer addSublayer:sublayer]; - return caLayer; -} diff --git a/content/shell/tools/plugin/main.cpp b/content/shell/tools/plugin/main.cpp index a36ff353d..bd3f4cd 100644 --- a/content/shell/tools/plugin/main.cpp +++ b/content/shell/tools/plugin/main.cpp @@ -162,12 +162,6 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc if (!supportsCoreGraphics) return NPERR_INCOMPATIBLE_VERSION_ERROR; - NPDrawingModel drawingModelToUse = NPDrawingModelCoreGraphics; - - NPBool supportsCoreAnimation; - if (browser->getvalue(instance, NPNVsupportsCoreAnimationBool, &supportsCoreAnimation) != NPERR_NO_ERROR) - supportsCoreAnimation = false; - #ifndef NP_NO_CARBON NPBool supportsCarbon = false; #endif @@ -200,7 +194,6 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc #ifdef XP_MACOSX obj->eventModel = eventModel; - obj->coreAnimationLayer = 0; #endif // XP_MACOSX obj->alwaysFilterEvents = false; @@ -253,23 +246,7 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc obj->onDestroy = base::strdup(argv[i]); else if (strcasecmp(argn[i], "testwindowopen") == 0) obj->testWindowOpen = true; - else if (strcasecmp(argn[i], "drawingmodel") == 0) { -#ifdef XP_MACOSX - const char* value = argv[i]; - if (strcasecmp(value, "coreanimation") == 0) { - if (supportsCoreAnimation) - drawingModelToUse = NPDrawingModelCoreAnimation; - else - return NPERR_INCOMPATIBLE_VERSION_ERROR; - } else if (strcasecmp(value, "coregraphics") == 0) { - if (supportsCoreGraphics) - drawingModelToUse = NPDrawingModelCoreGraphics; - else - return NPERR_INCOMPATIBLE_VERSION_ERROR; - } else - return NPERR_INCOMPATIBLE_VERSION_ERROR; -#endif - } else if (strcasecmp(argn[i], "testGetURLOnDestroy") == 0) { + else if (strcasecmp(argn[i], "testGetURLOnDestroy") == 0) { #if defined(XP_WIN) // FIXME: When https://bugs.webkit.org/show_bug.cgi?id=41831 is fixed, this #ifdef can be removed. obj->testGetURLOnDestroy = TRUE; @@ -302,9 +279,7 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc } #ifdef XP_MACOSX - browser->setvalue(instance, NPPVpluginDrawingModel, (void *)drawingModelToUse); - if (drawingModelToUse == NPDrawingModelCoreAnimation) - obj->coreAnimationLayer = createCoreAnimationLayer(); + browser->setvalue(instance, NPPVpluginDrawingModel, (void *)NPDrawingModelCoreGraphics); #endif obj->pluginTest = PluginTest::create(instance, testIdentifier); @@ -358,11 +333,6 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) fflush(stdout); } -#ifdef XP_MACOSX - if (obj->coreAnimationLayer) - CFRelease(obj->coreAnimationLayer); -#endif - if (obj->pluginTest) obj->pluginTest->NPP_Destroy(save); @@ -868,17 +838,6 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) return NPERR_NO_ERROR; } -#ifdef XP_MACOSX - if (variable == NPPVpluginCoreAnimationLayer) { - if (!obj->coreAnimationLayer) - return NPERR_GENERIC_ERROR; - - void **v = (void **)value; - *v = (void*)CFRetain(obj->coreAnimationLayer); - return NPERR_NO_ERROR; - } -#endif - return NPERR_GENERIC_ERROR; } diff --git a/third_party/WebKit/LayoutTests/NeverFixTests b/third_party/WebKit/LayoutTests/NeverFixTests index fbb12c9..8abb0e7 100644 --- a/third_party/WebKit/LayoutTests/NeverFixTests +++ b/third_party/WebKit/LayoutTests/NeverFixTests @@ -44,13 +44,6 @@ fast/harness/sample-fail-mismatch-reftest.html [ WontFix ] # <progress> on Mac is always animated. So it's hard to get a reliable pixel result. [ Mac ] fast/dom/HTMLProgressElement/progress-element.html [ WontFix ] -# These test the CoreAnimation plugin model which we never intend to support on -# Windows and Linux. -[ Win Linux ] compositing/plugins/1x1-composited-plugin.html [ WontFix ] -[ Win Linux ] compositing/plugins/composited-plugin.html [ WontFix ] -[ Win Linux ] compositing/plugins/large-to-small-composited-plugin.html [ WontFix ] -[ Win Linux ] compositing/plugins/small-to-large-composited-plugin.html [ WontFix ] - # Mac's popup behavior is different. [ Mac ] fast/forms/select/menulist-onchange-fired-with-key-up-down.html [ WontFix ] [ Mac ] fast/forms/select/popup-with-display-none-optgroup.html [ WontFix ] diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/1x1-composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/compositing/plugins/1x1-composited-plugin-expected.txt deleted file mode 100644 index 7c83487..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/1x1-composited-plugin-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ - -PASS: no layers found diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/1x1-composited-plugin.html b/third_party/WebKit/LayoutTests/compositing/plugins/1x1-composited-plugin.html deleted file mode 100644 index 92b6e26..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/1x1-composited-plugin.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <style type="text/css" media="screen"> - embed { - height: 1px; - width: 1px; - border: 1px solid black; - } - </style> - <script type="text/javascript" charset="utf-8"> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - function doTest() - { - window.setTimeout(function() { - if (window.testRunner) { - document.getElementById('result').textContent = window.internals.layerTreeAsText(document); - testRunner.notifyDone(); - } - }, 0); - } - - window.addEventListener('load', doTest, false); - </script> -</head> -<body> - <embed type="application/x-webkit-test-netscape" width="1" height="1" drawingmodel="coreanimation"> - <embed type="application/x-webkit-test-netscape" width="100" height="0" drawingmodel="coreanimation"> - - <div id="result">Test only works in DRT</div> -</body> -</html> diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin-expected.png b/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin-expected.png Binary files differdeleted file mode 100644 index cc2cdc0..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin-expected.png +++ /dev/null diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin-expected.txt deleted file mode 100644 index ff2b62f..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin-expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x170 - LayoutBlockFlow {HTML} at (0,0) size 800x170 - LayoutBlockFlow {BODY} at (8,8) size 784x154 - LayoutEmbeddedObject {EMBED} at (0,0) size 300x150 - LayoutText {#text} at (0,0) size 0x0 diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin.html b/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin.html deleted file mode 100644 index 7e261e3..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/composited-plugin.html +++ /dev/null @@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - <script src="../../resources/plugin.js"></script> - <script>startAfterLoadAndFinish();</script> - <embed type="application/x-webkit-test-netscape" drawingmodel="coreanimation"> -</body> -</html> diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/large-to-small-composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/compositing/plugins/large-to-small-composited-plugin-expected.txt deleted file mode 100644 index a106f30..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/large-to-small-composited-plugin-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ - -PASS: no layers found diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/large-to-small-composited-plugin.html b/third_party/WebKit/LayoutTests/compositing/plugins/large-to-small-composited-plugin.html deleted file mode 100644 index 6bde5a1..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/large-to-small-composited-plugin.html +++ /dev/null @@ -1,53 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <style type="text/css" media="screen"> - embed { - width: 300px; - height: 150px; - border: 1px solid black; - } - - embed.small { - height: 1px; - width: 1px; - } - - .container { - height: 100px; - width: 200px; - overflow: hidden; - } - </style> - <script type="text/javascript" charset="utf-8"> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - function doTest() - { - window.setTimeout(function() { - document.getElementById('plugin').className = 'small'; - // Need to wait for compositing layers to be updated. - window.setTimeout(function() { - if (window.testRunner) { - document.getElementById('result').textContent = window.internals.layerTreeAsText(document); - testRunner.notifyDone(); - } - }, 0); - }, 0); - } - - window.addEventListener('load', doTest, false); - </script> -</head> -<body> - - <div class="container"> - <embed id="plugin" type="application/x-webkit-test-netscape" width="1" height="1" drawingmodel="coreanimation"> - </div> - - <div id="result">Test only works in DRT</div> -</body> -</html> diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/small-to-large-composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/compositing/plugins/small-to-large-composited-plugin-expected.txt deleted file mode 100644 index 139597f..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/small-to-large-composited-plugin-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/third_party/WebKit/LayoutTests/compositing/plugins/small-to-large-composited-plugin.html b/third_party/WebKit/LayoutTests/compositing/plugins/small-to-large-composited-plugin.html deleted file mode 100644 index d8ec148..0000000 --- a/third_party/WebKit/LayoutTests/compositing/plugins/small-to-large-composited-plugin.html +++ /dev/null @@ -1,54 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <style type="text/css" media="screen"> - embed { - height: 1px; - width: 1px; - border: 1px solid black; - } - - embed.large { - width: 300px; - height: 150px; - } - - .container { - height: 100px; - width: 200px; - overflow: hidden; - } - </style> - <script type="text/javascript" charset="utf-8"> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - function doTest() - { - window.setTimeout(function() { - document.getElementById('plugin').className = 'large'; - // Need to wait for compositing layers to be updated. FIXME remove. - window.setTimeout(function() { - if (window.testRunner) { - document.getElementById('layers').innerHTML = window.internals.layerTreeAsText(document); - testRunner.notifyDone(); - } - }, 0) - }, 0); - } - - window.addEventListener('load', doTest, false); - </script> -</head> -<body> - - <div class="container"> - <embed id="plugin" type="application/x-webkit-test-netscape" width="1" height="1" drawingmodel="coreanimation"> - </div> - - <!-- we should have layers after the resize --> - <pre id="layers">Layer tree appears here in DRT.</pre> -</body> -</html> diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/plugins/composited-plugin-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/plugins/composited-plugin-expected.png Binary files differdeleted file mode 100644 index 8914693..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/compositing/plugins/composited-plugin-expected.png +++ /dev/null diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/1x1-composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/1x1-composited-plugin-expected.txt deleted file mode 100644 index 7b029bf..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/1x1-composited-plugin-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ - -{ "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true } ] } diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.png Binary files differdeleted file mode 100644 index c2224dd..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.png +++ /dev/null diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.txt deleted file mode 100644 index bebca87..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/composited-plugin-expected.txt +++ /dev/null @@ -1,8 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x170 - LayoutBlockFlow {HTML} at (0,0) size 800x170 - LayoutBlockFlow {BODY} at (8,8) size 784x154 - LayoutText {#text} at (0,0) size 0x0 -layer at (8,8) size 300x150 - LayoutEmbeddedObject {EMBED} at (0,0) size 300x150 diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/large-to-small-composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/large-to-small-composited-plugin-expected.txt deleted file mode 100644 index 25aad9c..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/large-to-small-composited-plugin-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ - -{ "bounds": [800, 600], "children": [ { "bounds": [800, 600], "contentsOpaque": true, "drawsContent": true } ] } diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/small-to-large-composited-plugin-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/small-to-large-composited-plugin-expected.txt deleted file mode 100644 index 9f9c614..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/compositing/plugins/small-to-large-composited-plugin-expected.txt +++ /dev/null @@ -1,12 +0,0 @@ - -{ - "bounds": [800, 600], - "children": [ - { - "bounds": [800, 600], - "contentsOpaque": true, - "drawsContent": true - } - ] -} - |