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

Side by Side Diff: components/tracing/common/graphics_memory_dump_provider_android_unittest.cc

Issue 2028043002: tracing: restructure to the components/tracing folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/memory_allocator_dump.h" 5 #include "base/trace_event/memory_allocator_dump.h"
6 #include "base/trace_event/process_memory_dump.h" 6 #include "base/trace_event/process_memory_dump.h"
7 #include "base/trace_event/trace_event_argument.h" 7 #include "base/trace_event/trace_event_argument.h"
8 #include "components/tracing/graphics_memory_dump_provider_android.h" 8 #include "components/tracing/common/graphics_memory_dump_provider_android.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace tracing { 11 namespace tracing {
12 12
13 TEST(GraphicsMemoryDumpProviderTest, ParseResponse) { 13 TEST(GraphicsMemoryDumpProviderTest, ParseResponse) {
14 const char* kDumpBaseName = GraphicsMemoryDumpProvider::kDumpBaseName; 14 const char* kDumpBaseName = GraphicsMemoryDumpProvider::kDumpBaseName;
15 15
16 base::trace_event::ProcessMemoryDump pmd(nullptr); 16 base::trace_event::ProcessMemoryDump pmd(nullptr);
17 auto instance = GraphicsMemoryDumpProvider::GetInstance(); 17 auto instance = GraphicsMemoryDumpProvider::GetInstance();
18 char buf[] = "graphics_total 12\ngraphics_pss 34\ngl_total 56\ngl_pss 78"; 18 char buf[] = "graphics_total 12\ngraphics_pss 34\ngl_total 56\ngl_pss 78";
(...skipping 24 matching lines...) Expand all
43 json); 43 json);
44 44
45 // Test for truncated input. 45 // Test for truncated input.
46 pmd.Clear(); 46 pmd.Clear();
47 instance->ParseResponseAndAddToDump(buf, strlen(buf) - 14, &pmd); 47 instance->ParseResponseAndAddToDump(buf, strlen(buf) - 14, &pmd);
48 ASSERT_TRUE(pmd.GetAllocatorDump(kDumpBaseName + std::string("graphics"))); 48 ASSERT_TRUE(pmd.GetAllocatorDump(kDumpBaseName + std::string("graphics")));
49 ASSERT_FALSE(pmd.GetAllocatorDump(kDumpBaseName + std::string("gl"))); 49 ASSERT_FALSE(pmd.GetAllocatorDump(kDumpBaseName + std::string("gl")));
50 } 50 }
51 51
52 } // namespace tracing 52 } // namespace tracing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698