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

Side by Side Diff: trunk/src/base/debug/trace_event_unittest.cc

Issue 19572012: Revert 212230 "Create top-level separate targets for browser and..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 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 | « trunk/src/base/debug/trace_event_impl.cc ('k') | trunk/src/build/common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Deleted: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/debug/trace_event_unittest.h" 5 #include "base/debug/trace_event_unittest.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 TraceLog::TraceOptionsFromString("record-until-full")); 1670 TraceLog::TraceOptionsFromString("record-until-full"));
1671 EXPECT_EQ(TraceLog::RECORD_CONTINUOUSLY, 1671 EXPECT_EQ(TraceLog::RECORD_CONTINUOUSLY,
1672 TraceLog::TraceOptionsFromString("record-continuously")); 1672 TraceLog::TraceOptionsFromString("record-continuously"));
1673 EXPECT_EQ(TraceLog::RECORD_UNTIL_FULL | TraceLog::ENABLE_SAMPLING, 1673 EXPECT_EQ(TraceLog::RECORD_UNTIL_FULL | TraceLog::ENABLE_SAMPLING,
1674 TraceLog::TraceOptionsFromString("enable-sampling")); 1674 TraceLog::TraceOptionsFromString("enable-sampling"));
1675 EXPECT_EQ(TraceLog::RECORD_CONTINUOUSLY | TraceLog::ENABLE_SAMPLING, 1675 EXPECT_EQ(TraceLog::RECORD_CONTINUOUSLY | TraceLog::ENABLE_SAMPLING,
1676 TraceLog::TraceOptionsFromString( 1676 TraceLog::TraceOptionsFromString(
1677 "record-continuously,enable-sampling")); 1677 "record-continuously,enable-sampling"));
1678 } 1678 }
1679 1679
1680 // Not supported in split dll build. http://crbug.com/256965
1681 #if !defined(CHROME_SPLIT_DLL)
1680 TEST_F(TraceEventTestFixture, TraceSampling) { 1682 TEST_F(TraceEventTestFixture, TraceSampling) {
1681 event_watch_notification_ = 0; 1683 event_watch_notification_ = 0;
1682 TraceLog::GetInstance()->SetEnabled( 1684 TraceLog::GetInstance()->SetEnabled(
1683 CategoryFilter("*"), 1685 CategoryFilter("*"),
1684 TraceLog::Options(TraceLog::RECORD_UNTIL_FULL | 1686 TraceLog::Options(TraceLog::RECORD_UNTIL_FULL |
1685 TraceLog::ENABLE_SAMPLING)); 1687 TraceLog::ENABLE_SAMPLING));
1686 1688
1687 WaitableEvent* sampled = new WaitableEvent(false, false); 1689 WaitableEvent* sampled = new WaitableEvent(false, false);
1688 TraceLog::GetInstance()->InstallWaitableEventForSamplingTesting(sampled); 1690 TraceLog::GetInstance()->InstallWaitableEventForSamplingTesting(sampled);
1689 1691
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 EXPECT_STREQ(TRACE_EVENT_GET_SAMPLING_STATE(), "AAA"); 1731 EXPECT_STREQ(TRACE_EVENT_GET_SAMPLING_STATE(), "AAA");
1730 TRACE_EVENT_SET_SAMPLING_STATE("DDD", "name"); 1732 TRACE_EVENT_SET_SAMPLING_STATE("DDD", "name");
1731 sampled->Wait(); 1733 sampled->Wait();
1732 EXPECT_STREQ(TRACE_EVENT_GET_SAMPLING_STATE(), "DDD"); 1734 EXPECT_STREQ(TRACE_EVENT_GET_SAMPLING_STATE(), "DDD");
1733 } 1735 }
1734 sampled->Wait(); 1736 sampled->Wait();
1735 EXPECT_STREQ(TRACE_EVENT_GET_SAMPLING_STATE(), "DDD"); 1737 EXPECT_STREQ(TRACE_EVENT_GET_SAMPLING_STATE(), "DDD");
1736 1738
1737 EndTraceAndFlush(); 1739 EndTraceAndFlush();
1738 } 1740 }
1741 #endif // !CHROME_SPLIT_DLL
1739 1742
1740 class MyData : public base::debug::ConvertableToTraceFormat { 1743 class MyData : public base::debug::ConvertableToTraceFormat {
1741 public: 1744 public:
1742 MyData() {} 1745 MyData() {}
1743 virtual ~MyData() {} 1746 virtual ~MyData() {}
1744 1747
1745 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE { 1748 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
1746 out->append("{\"foo\":1}"); 1749 out->append("{\"foo\":1}");
1747 } 1750 }
1748 1751
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( 2018 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
2016 " bad_category ")); 2019 " bad_category "));
2017 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( 2020 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
2018 "")); 2021 ""));
2019 EXPECT_FALSE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( 2022 EXPECT_FALSE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
2020 "good_category")); 2023 "good_category"));
2021 } 2024 }
2022 2025
2023 } // namespace debug 2026 } // namespace debug
2024 } // namespace base 2027 } // namespace base
OLDNEW
« no previous file with comments | « trunk/src/base/debug/trace_event_impl.cc ('k') | trunk/src/build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698