2015-08-20 15:00:32 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "SkTraceMemoryDump.h"
|
|
|
|
|
|
|
|
#include "Test.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Build test for SkTraceMemoryDump.
|
|
|
|
*/
|
|
|
|
class TestSkTraceMemoryDump : public SkTraceMemoryDump {
|
|
|
|
public:
|
|
|
|
TestSkTraceMemoryDump() { }
|
|
|
|
~TestSkTraceMemoryDump() override { }
|
|
|
|
|
|
|
|
void dumpNumericValue(const char* dumpName, const char* valueName, const char* units,
|
|
|
|
uint64_t value) override { }
|
|
|
|
void setMemoryBacking(const char* dumpName, const char* backingType,
|
|
|
|
const char* backingObjectId) override { }
|
|
|
|
void setDiscardableMemoryBacking(
|
|
|
|
const char* dumpName,
|
|
|
|
const SkDiscardableMemory& discardableMemoryObject) override { }
|
2015-09-30 11:31:23 +00:00
|
|
|
LevelOfDetail getRequestedDetails() const override {
|
|
|
|
return SkTraceMemoryDump::kObjectsBreakdowns_LevelOfDetail;
|
|
|
|
}
|
2015-08-20 15:00:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DEF_TEST(SkTraceMemoryDump, reporter) {
|
|
|
|
TestSkTraceMemoryDump x;
|
|
|
|
x.dumpNumericValue("foobar", "size", "bytes", 42);
|
2015-09-30 11:31:23 +00:00
|
|
|
if (x.getRequestedDetails() == SkTraceMemoryDump::kObjectsBreakdowns_LevelOfDetail) {
|
|
|
|
x.dumpNumericValue("foobar/object1", "size", "bytes", 23);
|
|
|
|
}
|
2015-08-20 15:00:32 +00:00
|
|
|
}
|