Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: chrome/browser/ui/tabs/tab_strip_model_unittest.cc

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 1825
1826 DictionaryValue manifest; 1826 DictionaryValue manifest;
1827 manifest.SetString("name", "hi!"); 1827 manifest.SetString("name", "hi!");
1828 manifest.SetString("version", "1"); 1828 manifest.SetString("version", "1");
1829 std::string error; 1829 std::string error;
1830 scoped_refptr<Extension> extension_app( 1830 scoped_refptr<Extension> extension_app(
1831 Extension::Create(path, Extension::INVALID, manifest, Extension::NO_FLAGS, 1831 Extension::Create(path, Extension::INVALID, manifest, Extension::NO_FLAGS,
1832 &error)); 1832 &error));
1833 extension_app->launch_web_url_ = "http://www.google.com"; 1833 extension_app->launch_web_url_ = "http://www.google.com";
1834 TabContents* contents1 = CreateTabContents(); 1834 TabContents* contents1 = CreateTabContents();
1835 contents1->extension_tab_helper()->SetExtensionApp(extension_app); 1835 extensions::TabHelper::FromWebContents(contents1->web_contents())->
1836 SetExtensionApp(extension_app);
1836 TabContents* contents2 = CreateTabContents(); 1837 TabContents* contents2 = CreateTabContents();
1837 contents2->extension_tab_helper()->SetExtensionApp(extension_app); 1838 extensions::TabHelper::FromWebContents(contents2->web_contents())->
1839 SetExtensionApp(extension_app);
1838 TabContents* contents3 = CreateTabContents(); 1840 TabContents* contents3 = CreateTabContents();
1839 1841
1840 SetID(contents1->web_contents(), 1); 1842 SetID(contents1->web_contents(), 1);
1841 SetID(contents2->web_contents(), 2); 1843 SetID(contents2->web_contents(), 2);
1842 SetID(contents3->web_contents(), 3); 1844 SetID(contents3->web_contents(), 3);
1843 1845
1844 // Note! The ordering of these tests is important, each subsequent test 1846 // Note! The ordering of these tests is important, each subsequent test
1845 // builds on the state established in the previous. This is important if you 1847 // builds on the state established in the previous. This is important if you
1846 // ever insert tests rather than append. 1848 // ever insert tests rather than append.
1847 1849
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 ASSERT_EQ(1, observer.GetStateCount()); 2441 ASSERT_EQ(1, observer.GetStateCount());
2440 MockTabStripModelObserver::State s( 2442 MockTabStripModelObserver::State s(
2441 contents2, 1, MockTabStripModelObserver::SELECT); 2443 contents2, 1, MockTabStripModelObserver::SELECT);
2442 s.src_contents = contents2; 2444 s.src_contents = contents2;
2443 s.src_index = 1; 2445 s.src_index = 1;
2444 s.user_gesture = false; 2446 s.user_gesture = false;
2445 EXPECT_TRUE(observer.StateEquals(0, s)); 2447 EXPECT_TRUE(observer.StateEquals(0, s));
2446 strip.RemoveObserver(&observer); 2448 strip.RemoveObserver(&observer);
2447 strip.CloseAllTabs(); 2449 strip.CloseAllTabs();
2448 } 2450 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model.cc ('k') | chrome/browser/ui/views/create_application_shortcut_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698