Skip to content

Commit

Permalink
Revert of skia: Add 'skia_unittests' test suite for this directory. (…
Browse files Browse the repository at this point in the history
…patchset chromium#12 id:220001 of https://codereview.chromium.org/815023003/)

Reason for revert:
Fails linking on the Mac GN builder:
http://build.chromium.org/p/chromium.mac/builders/Mac%20GN/builds/2094
duplicate symbol __ZN3gfx27SkMatrixToCGAffineTransformERK8SkMatrix in:
    obj/skia/ext/skia_unittests.skia_utils_mac_unittest.o
    obj/skia/ext/skia.skia_utils_mac.o
(and more similar issues)

Original issue's description:
> skia: Add 'skia_unittests' test suite for this directory.
>
> This should be a lightweight test suite that should allow a dev changing
> something in skia/ext to test it much more quickly than having to build
> all 'unit_tests' target just to run the tests from skia/ext.
>
> BUG=444058
> TEST=skia_unittests links and runs fine.
> R=danakj@chromium.org,thakis@chromium.org
>
> Committed: https://crrev.com/c87c3d2d949f9ba4f17627dc023b303c75b7635f
> Cr-Commit-Position: refs/heads/master@{#310310}

TBR=danakj@chromium.org,thakis@chromium.org,glider@chromium.org,sky@chromium.org,tfarina@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=444058

Review URL: https://codereview.chromium.org/816803003

Cr-Commit-Position: refs/heads/master@{#310314}
  • Loading branch information
mkruisselbrink authored and Commit bot committed Jan 7, 2015
1 parent cf6d3b1 commit 164a39b
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 186 deletions.
9 changes: 0 additions & 9 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@
'../components/components_tests.gyp:components_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../net/net.gyp:net_unittests',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../ui/base/ui_base_tests.gyp:ui_base_unittests',
Expand Down Expand Up @@ -840,7 +839,6 @@
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../sandbox/sandbox.gyp:sandbox_linux_unittests_deps',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../testing/android/junit/junit_test.gyp:junit_unit_tests',
Expand Down Expand Up @@ -875,7 +873,6 @@
'../media/media.gyp:media_unittests_apk',
'../net/net.gyp:net_unittests_apk',
'../sandbox/sandbox.gyp:sandbox_linux_jni_unittests_apk',
'../skia/skia_tests.gyp:skia_unittests_apk',
'../sql/sql.gyp:sql_unittests_apk',
'../sync/sync.gyp:sync_unit_tests_apk',
'../tools/android/heap_profiler/heap_profiler.gyp:heap_profiler_unittests_apk',
Expand Down Expand Up @@ -948,7 +945,6 @@
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../rlz/rlz.gyp:*',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
Expand Down Expand Up @@ -986,7 +982,6 @@
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
Expand Down Expand Up @@ -1037,7 +1032,6 @@
'../google_apis/gcm/gcm.gyp:gcm_unit_tests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
Expand Down Expand Up @@ -1087,7 +1081,6 @@
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
Expand Down Expand Up @@ -1188,7 +1181,6 @@
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../skia/skia_tests.gyp:skia_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
Expand Down Expand Up @@ -1285,7 +1277,6 @@
'../google_apis/gcm/gcm.gyp:gcm_unit_tests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../skia/skia_tests.gyp:skia_unittests',
'../ui/app_list/app_list.gyp:*',
'../ui/aura/aura.gyp:*',
'../ui/base/ui_base_tests.gyp:ui_base_unittests',
Expand Down
17 changes: 17 additions & 0 deletions chrome/chrome_tests_unit.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,17 @@
'../components/search_engines/template_url_service_sync_unittest.cc',
'../components/search_engines/template_url_service_unittest.cc',

'../skia/ext/analysis_canvas_unittest.cc',
'../skia/ext/bitmap_platform_device_mac_unittest.cc',
'../skia/ext/convolver_unittest.cc',
'../skia/ext/image_operations_unittest.cc',
'../skia/ext/pixel_ref_utils_unittest.cc',
'../skia/ext/platform_canvas_unittest.cc',
'../skia/ext/recursive_gaussian_convolution_unittest.cc',
'../skia/ext/refptr_unittest.cc',
'../skia/ext/skia_utils_ios_unittest.mm',
'../skia/ext/skia_utils_mac_unittest.mm',
'../skia/ext/vector_canvas_unittest.cc',
'../testing/gtest_mac_unittest.mm',
'../third_party/zlib/google/zip_reader_unittest.cc',
'../third_party/zlib/google/zip_unittest.cc',
Expand Down Expand Up @@ -2467,6 +2478,11 @@
'tools/convert_dict/convert_dict.gyp:convert_dict_lib',
],
}],
['OS!="win" and OS!="mac"', {
'sources!': [
'../skia/ext/platform_canvas_unittest.cc',
],
}],
['OS=="win" or OS=="mac"', {
'sources': [
'browser/media_galleries/fileapi/itunes_file_util_unittest.cc',
Expand Down Expand Up @@ -2545,6 +2561,7 @@
'browser/search_engines/template_url_scraper_unittest.cc',
'browser/ui/views/extensions/browser_action_drag_data_unittest.cc',
'test/data/resource.rc',
'../skia/ext/vector_canvas_unittest.cc',
],
}],
['OS=="android" or OS=="ios"', {
Expand Down
46 changes: 0 additions & 46 deletions skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import("//build/config/ui.gni")
if (cpu_arch == "arm") {
import("//build/config/arm.gni")
}
if (is_android) {
import("//build/config/android/rules.gni")
}

skia_support_gpu = !is_ios
skia_support_pdf = !is_ios && (enable_basic_printing || enable_print_preview)
Expand Down Expand Up @@ -713,46 +710,3 @@ source_set("skia_opts") {

visibility = [ ":skia" ]
}

test("skia_unittests") {
sources = [
"ext/analysis_canvas_unittest.cc",
"ext/bitmap_platform_device_mac_unittest.cc",
"ext/convolver_unittest.cc",
"ext/image_operations_unittest.cc",
"ext/pixel_ref_utils_unittest.cc",
"ext/platform_canvas_unittest.cc",
"ext/recursive_gaussian_convolution_unittest.cc",
"ext/refptr_unittest.cc",
"ext/skia_utils_ios_unittest.mm",
"ext/skia_utils_mac_unittest.mm",
"ext/vector_canvas_unittest.cc",
]

if (!is_win) {
sources -= [ "ext/vector_canvas_unittest.cc" ]
}

if (!is_win && !is_mac) {
sources -= [ "ext/platform_canvas_unittest.cc" ]
}

deps = [
":skia",
"//base",
"//base/test:run_all_unittests",
"//testing/gtest",
"//ui/gfx",
"//ui/gfx/geometry",
]
}

if (is_android) {
# GYP: //skia/skia_tests.gyp:skia_unittests_apk
unittest_apk("skia_unittests_apk") {
unittests_dep = ":skia_unittests"
deps = [
":skia_unittests",
]
}
}
29 changes: 12 additions & 17 deletions skia/ext/platform_canvas_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@

// TODO(awalker): clean up the const/non-const reference handling in this test

#include "skia/ext/platform_canvas.h"

#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "build/build_config.h"
#include "skia/ext/platform_device.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkPixelRef.h"

#if defined(OS_MACOSX)
#import <ApplicationServices/ApplicationServices.h>
Expand All @@ -24,6 +14,15 @@
#include <unistd.h>
#endif

#include "base/memory/scoped_ptr.h"
#include "skia/ext/platform_canvas.h"
#include "skia/ext/platform_device.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkPixelRef.h"

namespace skia {

namespace {
Expand Down Expand Up @@ -68,12 +67,8 @@ bool VerifyRect(const PlatformCanvas& canvas,
// rectangle. Basically, we're just checking to make sure that the pixels in the
// middle are of rect_color and pixels in the corners are of canvas_color.
bool VerifyRoundedRect(const PlatformCanvas& canvas,
uint32_t canvas_color,
uint32_t rect_color,
int x,
int y,
int w,
int h) {
uint32_t canvas_color, uint32_t rect_color,
int x, int y, int w, int h) {
SkBaseDevice* device = skia::GetTopDevice(canvas);
const SkBitmap& bitmap = device->accessBitmap(false);
SkAutoLockPixels lock(bitmap);
Expand Down Expand Up @@ -131,7 +126,7 @@ void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
}
#else
void DrawNativeRect(PlatformCanvas& canvas, int x, int y, int w, int h) {
NOTIMPLEMENTED();
notImplemented();
}
#endif

Expand Down
65 changes: 0 additions & 65 deletions skia/skia_tests.gyp

This file was deleted.

5 changes: 1 addition & 4 deletions testing/buildbot/chromium.chromiumos.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@
"athena_unittests",
"app_shell_browsertests",
"app_shell_unittests",
"chromevox_tests",
"skia_unittests"
"chromevox_tests"
]
},
"Linux ChromiumOS Ozone Tests (1)": {
Expand Down Expand Up @@ -150,7 +149,6 @@
"test": "sandbox_linux_unittests",
"args": ["--test-launcher-print-test-stdio=always"]
},
"skia_unittests",
"sql_unittests",
"sync_unit_tests",
"ui_base_unittests",
Expand Down Expand Up @@ -252,7 +250,6 @@
},
"athena_unittests",
"gcm_unit_tests",
"skia_unittests",
{
"test": "interactive_ui_tests",
"swarming": {
Expand Down
5 changes: 0 additions & 5 deletions testing/buildbot/chromium.fyi.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"printing_unittests",
"remoting_unittests",
"sandbox_linux_unittests",
"skia_unittests",
"ui_base_unittests",
"ui_touch_selection_unittests",
"ipc_tests",
Expand Down Expand Up @@ -99,7 +98,6 @@
"printing_unittests",
"remoting_unittests",
"sandbox_linux_unittests",
"skia_unittests",
"ui_base_unittests",
"ui_touch_selection_unittests",
"ipc_tests",
Expand Down Expand Up @@ -166,7 +164,6 @@
"printing_unittests",
"remoting_unittests",
"sandbox_linux_unittests",
"skia_unittests",
"ui_base_unittests",
"ui_touch_selection_unittests",
"ipc_tests",
Expand Down Expand Up @@ -233,7 +230,6 @@
"printing_unittests",
"remoting_unittests",
"sandbox_linux_unittests",
"skia_unittests",
"ui_base_unittests",
"ui_touch_selection_unittests",
"ipc_tests",
Expand Down Expand Up @@ -309,7 +305,6 @@
"printing_unittests",
"remoting_unittests",
"sandbox_mac_unittests",
"skia_unittests",
"sql_unittests",
"sync_integration_tests",
"sync_unit_tests",
Expand Down
12 changes: 4 additions & 8 deletions testing/buildbot/chromium.linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@
},
"url_unittests",
"views_unittests",
"wm_unittests",
"skia_unittests"
"wm_unittests"
],
"scripts": [
{
Expand Down Expand Up @@ -263,8 +262,7 @@
},
"url_unittests",
"views_unittests",
"wm_unittests",
"skia_unittests"
"wm_unittests"
],
"scripts": [
{
Expand Down Expand Up @@ -400,8 +398,7 @@
},
"url_unittests",
"views_unittests",
"wm_unittests",
"skia_unittests"
"wm_unittests"
],
"scripts": [
{
Expand Down Expand Up @@ -443,8 +440,7 @@
"sql_unittests",
"sync_unit_tests",
"ui_base_unittests",
"unit_tests",
"skia_unittests"
"unit_tests"
]
}
}
Loading

0 comments on commit 164a39b

Please sign in to comment.