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/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1714 DictionaryValue manifest; | 1714 DictionaryValue manifest; |
1715 manifest.SetString("name", "hi!"); | 1715 manifest.SetString("name", "hi!"); |
1716 manifest.SetString("version", "1"); | 1716 manifest.SetString("version", "1"); |
1717 manifest.SetString("app.launch.web_url", "http://www.google.com"); | 1717 manifest.SetString("app.launch.web_url", "http://www.google.com"); |
1718 std::string error; | 1718 std::string error; |
1719 scoped_refptr<Extension> extension_app( | 1719 scoped_refptr<Extension> extension_app( |
1720 Extension::Create(path, extensions::Manifest::INVALID_LOCATION, | 1720 Extension::Create(path, extensions::Manifest::INVALID_LOCATION, |
1721 manifest, Extension::NO_FLAGS, &error)); | 1721 manifest, Extension::NO_FLAGS, &error)); |
1722 WebContents* contents1 = CreateWebContents(); | 1722 WebContents* contents1 = CreateWebContents(); |
1723 extensions::TabHelper::CreateForWebContents(contents1); | 1723 extensions::TabHelper::CreateForWebContents(contents1); |
1724 extensions::TabHelper::FromWebContents(contents1)-> | 1724 extensions::TabHelper::FromWebContents(contents1) |
1725 SetExtensionApp(extension_app); | 1725 ->SetExtensionApp(extension_app.get()); |
1726 WebContents* contents2 = CreateWebContents(); | 1726 WebContents* contents2 = CreateWebContents(); |
1727 extensions::TabHelper::CreateForWebContents(contents2); | 1727 extensions::TabHelper::CreateForWebContents(contents2); |
1728 extensions::TabHelper::FromWebContents(contents2)-> | 1728 extensions::TabHelper::FromWebContents(contents2) |
1729 SetExtensionApp(extension_app); | 1729 ->SetExtensionApp(extension_app.get()); |
1730 WebContents* contents3 = CreateWebContents(); | 1730 WebContents* contents3 = CreateWebContents(); |
1731 | 1731 |
1732 SetID(contents1, 1); | 1732 SetID(contents1, 1); |
1733 SetID(contents2, 2); | 1733 SetID(contents2, 2); |
1734 SetID(contents3, 3); | 1734 SetID(contents3, 3); |
1735 | 1735 |
1736 // Note! The ordering of these tests is important, each subsequent test | 1736 // Note! The ordering of these tests is important, each subsequent test |
1737 // builds on the state established in the previous. This is important if you | 1737 // builds on the state established in the previous. This is important if you |
1738 // ever insert tests rather than append. | 1738 // ever insert tests rather than append. |
1739 | 1739 |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 strip.ActivateTabAt(1, true); | 2333 strip.ActivateTabAt(1, true); |
2334 ASSERT_EQ(1, observer.GetStateCount()); | 2334 ASSERT_EQ(1, observer.GetStateCount()); |
2335 State s(contents2, 1, MockTabStripModelObserver::SELECT); | 2335 State s(contents2, 1, MockTabStripModelObserver::SELECT); |
2336 s.src_contents = contents2; | 2336 s.src_contents = contents2; |
2337 s.src_index = 1; | 2337 s.src_index = 1; |
2338 s.change_reason = TabStripModelObserver::CHANGE_REASON_NONE; | 2338 s.change_reason = TabStripModelObserver::CHANGE_REASON_NONE; |
2339 EXPECT_TRUE(observer.StateEquals(0, s)); | 2339 EXPECT_TRUE(observer.StateEquals(0, s)); |
2340 strip.RemoveObserver(&observer); | 2340 strip.RemoveObserver(&observer); |
2341 strip.CloseAllTabs(); | 2341 strip.CloseAllTabs(); |
2342 } | 2342 } |
OLD | NEW |