OLD | NEW |
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 "chrome/browser/tabs/tab_strip_model.h" | 5 #include "chrome/browser/tabs/tab_strip_model.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "content/public/browser/notification_registrar.h" | 36 #include "content/public/browser/notification_registrar.h" |
37 #include "content/public/browser/notification_source.h" | 37 #include "content/public/browser/notification_source.h" |
38 #include "content/public/browser/notification_types.h" | 38 #include "content/public/browser/notification_types.h" |
39 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
40 #include "content/test/notification_observer_mock.h" | 40 #include "content/test/notification_observer_mock.h" |
41 #include "content/test/test_browser_thread.h" | 41 #include "content/test/test_browser_thread.h" |
42 #include "testing/gtest/include/gtest/gtest.h" | 42 #include "testing/gtest/include/gtest/gtest.h" |
43 | 43 |
44 using content::BrowserThread; | 44 using content::BrowserThread; |
45 using content::NavigationController; | 45 using content::NavigationController; |
| 46 using content::SiteInstance; |
46 using content::WebContents; | 47 using content::WebContents; |
47 using testing::_; | 48 using testing::_; |
48 | 49 |
49 namespace { | 50 namespace { |
50 | 51 |
51 // Class used to delete a TabContents when another TabContents is destroyed. | 52 // Class used to delete a TabContents when another TabContents is destroyed. |
52 class DeleteTabContentsOnDestroyedObserver | 53 class DeleteTabContentsOnDestroyedObserver |
53 : public content::NotificationObserver { | 54 : public content::NotificationObserver { |
54 public: | 55 public: |
55 DeleteTabContentsOnDestroyedObserver(TabContentsWrapper* source, | 56 DeleteTabContentsOnDestroyedObserver(TabContentsWrapper* source, |
(...skipping 2302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 ASSERT_EQ(1, observer.GetStateCount()); | 2359 ASSERT_EQ(1, observer.GetStateCount()); |
2359 MockTabStripModelObserver::State s( | 2360 MockTabStripModelObserver::State s( |
2360 contents2, 1, MockTabStripModelObserver::SELECT); | 2361 contents2, 1, MockTabStripModelObserver::SELECT); |
2361 s.src_contents = contents2; | 2362 s.src_contents = contents2; |
2362 s.src_index = 1; | 2363 s.src_index = 1; |
2363 s.user_gesture = false; | 2364 s.user_gesture = false; |
2364 EXPECT_TRUE(observer.StateEquals(0, s)); | 2365 EXPECT_TRUE(observer.StateEquals(0, s)); |
2365 strip.RemoveObserver(&observer); | 2366 strip.RemoveObserver(&observer); |
2366 strip.CloseAllTabs(); | 2367 strip.CloseAllTabs(); |
2367 } | 2368 } |
OLD | NEW |