OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/trace_subscriber_stdio.h" | 5 #include "content/browser/trace_subscriber_stdio.h" |
6 | 6 |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 10 matching lines...) Expand all Loading... | |
21 EXPECT_TRUE(file_util::ReadFileToString(trace_file_, &result)); | 21 EXPECT_TRUE(file_util::ReadFileToString(trace_file_, &result)); |
22 return result; | 22 return result; |
23 } | 23 } |
24 | 24 |
25 ScopedTempDir trace_dir_; | 25 ScopedTempDir trace_dir_; |
26 FilePath trace_file_; | 26 FilePath trace_file_; |
27 }; | 27 }; |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 TEST_F(TraceSubscriberStdioTest, CanWriteBracketedDataToFile) { | 31 TEST_F(TraceSubscriberStdioTest, CanWriteDataToFile) { |
32 TraceSubscriberStdio subscriber(trace_file_); | 32 TraceSubscriberStdio subscriber(trace_file_); |
33 subscriber.OnTraceDataCollected("[foo]"); | 33 subscriber.OnTraceDataCollected("[foo]"); |
34 subscriber.OnTraceDataCollected("[bar]"); | 34 subscriber.OnTraceDataCollected("[bar]"); |
35 EXPECT_TRUE(subscriber.IsValid()); | 35 EXPECT_TRUE(subscriber.IsValid()); |
36 | 36 |
37 subscriber.OnEndTracingComplete(); | 37 subscriber.OnEndTracingComplete(); |
38 EXPECT_FALSE(subscriber.IsValid()); | 38 EXPECT_FALSE(subscriber.IsValid()); |
39 | |
40 EXPECT_EQ("[foo,bar,]", ReadTraceFile()); | |
nduca
2011/10/20 00:28:03
why'd this get deleted? merge issue?
jbates
2011/10/20 22:18:49
This isn't the place to test the bracket formattin
| |
41 } | 39 } |
42 | 40 |
OLD | NEW |