| 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/ui/tabs/tab_strip_model.h" | 5 #include "chrome/browser/ui/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 21 matching lines...) Expand all Loading... |
| 32 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 32 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 33 #include "chrome/test/base/testing_profile.h" | 33 #include "chrome/test/base/testing_profile.h" |
| 34 #include "content/public/browser/navigation_controller.h" | 34 #include "content/public/browser/navigation_controller.h" |
| 35 #include "content/public/browser/navigation_entry.h" | 35 #include "content/public/browser/navigation_entry.h" |
| 36 #include "content/public/browser/notification_details.h" | 36 #include "content/public/browser/notification_details.h" |
| 37 #include "content/public/browser/notification_registrar.h" | 37 #include "content/public/browser/notification_registrar.h" |
| 38 #include "content/public/browser/notification_source.h" | 38 #include "content/public/browser/notification_source.h" |
| 39 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
| 40 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
| 41 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
| 42 #include "content/test/notification_observer_mock.h" | |
| 43 #include "content/test/test_browser_thread.h" | 42 #include "content/test/test_browser_thread.h" |
| 44 #include "testing/gtest/include/gtest/gtest.h" | 43 #include "testing/gtest/include/gtest/gtest.h" |
| 45 | 44 |
| 46 using content::BrowserThread; | 45 using content::BrowserThread; |
| 47 using content::NavigationController; | 46 using content::NavigationController; |
| 48 using content::SiteInstance; | 47 using content::SiteInstance; |
| 49 using content::WebContents; | 48 using content::WebContents; |
| 50 using extensions::Extension; | 49 using extensions::Extension; |
| 51 using testing::_; | |
| 52 | 50 |
| 53 namespace { | 51 namespace { |
| 54 | 52 |
| 55 // Class used to delete a TabContentsWrapper when another TabContentsWrapper is | 53 // Class used to delete a TabContentsWrapper when another TabContentsWrapper is |
| 56 // destroyed. | 54 // destroyed. |
| 57 class DeleteTabContentsOnDestroyedObserver | 55 class DeleteTabContentsOnDestroyedObserver |
| 58 : public content::NotificationObserver { | 56 : public content::NotificationObserver { |
| 59 public: | 57 public: |
| 60 DeleteTabContentsOnDestroyedObserver(TabContentsWrapper* source, | 58 DeleteTabContentsOnDestroyedObserver(TabContentsWrapper* source, |
| 61 TabContentsWrapper* tab_to_delete) | 59 TabContentsWrapper* tab_to_delete) |
| (...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2441 ASSERT_EQ(1, observer.GetStateCount()); | 2439 ASSERT_EQ(1, observer.GetStateCount()); |
| 2442 MockTabStripModelObserver::State s( | 2440 MockTabStripModelObserver::State s( |
| 2443 contents2, 1, MockTabStripModelObserver::SELECT); | 2441 contents2, 1, MockTabStripModelObserver::SELECT); |
| 2444 s.src_contents = contents2; | 2442 s.src_contents = contents2; |
| 2445 s.src_index = 1; | 2443 s.src_index = 1; |
| 2446 s.user_gesture = false; | 2444 s.user_gesture = false; |
| 2447 EXPECT_TRUE(observer.StateEquals(0, s)); | 2445 EXPECT_TRUE(observer.StateEquals(0, s)); |
| 2448 strip.RemoveObserver(&observer); | 2446 strip.RemoveObserver(&observer); |
| 2449 strip.CloseAllTabs(); | 2447 strip.CloseAllTabs(); |
| 2450 } | 2448 } |
| OLD | NEW |