| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/common/child_process_logging.h" | 5 #include "chrome/common/child_process_logging.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 NSString *expected_url = [NSString stringWithUTF8String:url.c_str()]; | 72 NSString *expected_url = [NSString stringWithUTF8String:url.c_str()]; |
| 73 return([accumulated_url isEqualToString:expected_url]); | 73 return([accumulated_url isEqualToString:expected_url]); |
| 74 } | 74 } |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 static NSMutableDictionary* dict; | 77 static NSMutableDictionary* dict; |
| 78 DISALLOW_COPY_AND_ASSIGN(MockBreakpadKeyValueStore); | 78 DISALLOW_COPY_AND_ASSIGN(MockBreakpadKeyValueStore); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 /* static */ |
| 82 NSMutableDictionary* MockBreakpadKeyValueStore::dict; |
| 83 |
| 81 } // namespace | 84 } // namespace |
| 82 | 85 |
| 83 // Call through to SetActiveURLImpl using the functions from | 86 // Call through to SetActiveURLImpl using the functions from |
| 84 // MockBreakpadKeyValueStore. | 87 // MockBreakpadKeyValueStore. |
| 85 void SetActiveURLWithMock(const GURL& url) { | 88 void SetActiveURLWithMock(const GURL& url) { |
| 86 using child_process_logging::SetActiveURLImpl; | 89 using child_process_logging::SetActiveURLImpl; |
| 87 | 90 |
| 88 SetCrashKeyValueFuncPtr setFunc = MockBreakpadKeyValueStore::SetKeyValue; | 91 SetCrashKeyValueFuncPtr setFunc = MockBreakpadKeyValueStore::SetKeyValue; |
| 89 ClearCrashKeyValueFuncPtr clearFunc = | 92 ClearCrashKeyValueFuncPtr clearFunc = |
| 90 MockBreakpadKeyValueStore::ClearKeyValue; | 93 MockBreakpadKeyValueStore::ClearKeyValue; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 EXPECT_EQ(mock.CountDictionaryEntries(), 0); | 132 EXPECT_EQ(mock.CountDictionaryEntries(), 0); |
| 130 | 133 |
| 131 | 134 |
| 132 // Check that overflow works correctly. | 135 // Check that overflow works correctly. |
| 133 SetActiveURLWithMock(GURL(overflow_url.c_str())); | 136 SetActiveURLWithMock(GURL(overflow_url.c_str())); |
| 134 EXPECT_TRUE(mock.VerifyDictionaryContents( | 137 EXPECT_TRUE(mock.VerifyDictionaryContents( |
| 135 overflow_url.substr(0, max_num_chars_stored_in_dump))); | 138 overflow_url.substr(0, max_num_chars_stored_in_dump))); |
| 136 SetActiveURLWithMock(GURL()); | 139 SetActiveURLWithMock(GURL()); |
| 137 EXPECT_EQ(mock.CountDictionaryEntries(), 0); | 140 EXPECT_EQ(mock.CountDictionaryEntries(), 0); |
| 138 } | 141 } |
| OLD | NEW |