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

Side by Side Diff: chrome/browser/extensions/page_action_controller_unittest.cc

Issue 10827204: Test within-page navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 NavigateAndCommit(GURL("http://www.google.com")); 71 NavigateAndCommit(GURL("http://www.google.com"));
72 72
73 extension->page_action()->SetTitle(tab_id(), "Goodbye"); 73 extension->page_action()->SetTitle(tab_id(), "Goodbye");
74 extension->page_action()->SetPopupUrl( 74 extension->page_action()->SetPopupUrl(
75 tab_id(), extension->GetResourceURL("popup.html")); 75 tab_id(), extension->GetResourceURL("popup.html"));
76 76
77 EXPECT_EQ("Goodbye", extension->page_action()->GetTitle(tab_id())); 77 EXPECT_EQ("Goodbye", extension->page_action()->GetTitle(tab_id()));
78 EXPECT_EQ(extension->GetResourceURL("popup.html"), 78 EXPECT_EQ(extension->GetResourceURL("popup.html"),
79 extension->page_action()->GetPopupUrl(tab_id())); 79 extension->page_action()->GetPopupUrl(tab_id()));
80 80
81 // Within-page navigation should keep the settings.
82 NavigateAndCommit(GURL("http://www.google.com/#hash"));
83
84 EXPECT_EQ("Goodbye", extension->page_action()->GetTitle(tab_id()));
85 EXPECT_EQ(extension->GetResourceURL("popup.html"),
86 extension->page_action()->GetPopupUrl(tab_id()));
87
81 // Should discard the settings, and go back to the defaults. 88 // Should discard the settings, and go back to the defaults.
82 NavigateAndCommit(GURL("http://www.yahoo.com")); 89 NavigateAndCommit(GURL("http://www.yahoo.com"));
83 90
84 EXPECT_EQ("Hello", extension->page_action()->GetTitle(tab_id())); 91 EXPECT_EQ("Hello", extension->page_action()->GetTitle(tab_id()));
85 EXPECT_EQ(GURL(), extension->page_action()->GetPopupUrl(tab_id())); 92 EXPECT_EQ(GURL(), extension->page_action()->GetPopupUrl(tab_id()));
86 }; 93 };
87 94
88 } // namespace 95 } // namespace
89 } // namespace extensions 96 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698