| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/background_page_tracker.h" | 8 #include "chrome/browser/background_page_tracker.h" |
| 9 #include "chrome/common/chrome_switches.h" | |
| 10 #include "chrome/common/notification_service.h" | 9 #include "chrome/common/notification_service.h" |
| 11 #include "chrome/common/notification_type.h" | 10 #include "chrome/common/notification_type.h" |
| 12 #include "chrome/test/testing_pref_service.h" | 11 #include "chrome/test/testing_pref_service.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "testing/platform_test.h" | 13 #include "testing/platform_test.h" |
| 15 | 14 |
| 16 class MockBackgroundPageTracker : public BackgroundPageTracker { | 15 class MockBackgroundPageTracker : public BackgroundPageTracker { |
| 17 public: | 16 public: |
| 18 MockBackgroundPageTracker() { | 17 MockBackgroundPageTracker() { |
| 19 BackgroundPageTracker::RegisterPrefs(&prefs_); | 18 BackgroundPageTracker::RegisterPrefs(&prefs_); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 tracker.OnBackgroundPageLoaded(app2); | 111 tracker.OnBackgroundPageLoaded(app2); |
| 113 EXPECT_EQ(2, counter.count()); | 112 EXPECT_EQ(2, counter.count()); |
| 114 // Acknowledging pages should generate notification. | 113 // Acknowledging pages should generate notification. |
| 115 tracker.AcknowledgeBackgroundPages(); | 114 tracker.AcknowledgeBackgroundPages(); |
| 116 EXPECT_EQ(3, counter.count()); | 115 EXPECT_EQ(3, counter.count()); |
| 117 tracker.OnBackgroundPageLoaded(app1); | 116 tracker.OnBackgroundPageLoaded(app1); |
| 118 EXPECT_EQ(3, counter.count()); | 117 EXPECT_EQ(3, counter.count()); |
| 119 tracker.OnBackgroundPageLoaded(app3); | 118 tracker.OnBackgroundPageLoaded(app3); |
| 120 EXPECT_EQ(4, counter.count()); | 119 EXPECT_EQ(4, counter.count()); |
| 121 } | 120 } |
| OLD | NEW |