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

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

Issue 2561983002: NavigationController: Reload methods migration (Closed)
Patch Set: merge master Created 4 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/extension_action_runner.h" 5 #include "chrome/browser/extensions/extension_action_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Confirm that we refreshed the page. 488 // Confirm that we refreshed the page.
489 EXPECT_GE(entry->GetUniqueID(), first_nav_id); 489 EXPECT_GE(entry->GetUniqueID(), first_nav_id);
490 EXPECT_EQ("success", GetValue(web_contents)); 490 EXPECT_EQ("success", GetValue(web_contents));
491 EXPECT_FALSE(runner->WantsToRun(extension)); 491 EXPECT_FALSE(runner->WantsToRun(extension));
492 492
493 // Revoke permission and reload to try different bubble options. 493 // Revoke permission and reload to try different bubble options.
494 ActiveTabPermissionGranter* active_tab_granter = 494 ActiveTabPermissionGranter* active_tab_granter =
495 TabHelper::FromWebContents(web_contents)->active_tab_permission_granter(); 495 TabHelper::FromWebContents(web_contents)->active_tab_permission_granter();
496 ASSERT_TRUE(active_tab_granter); 496 ASSERT_TRUE(active_tab_granter);
497 active_tab_granter->RevokeForTesting(); 497 active_tab_granter->RevokeForTesting();
498 web_contents->GetController().Reload(true); 498 web_contents->GetController().Reload(content::ReloadType::NORMAL, true);
499 EXPECT_TRUE(content::WaitForLoadStop(web_contents)); 499 EXPECT_TRUE(content::WaitForLoadStop(web_contents));
500 500
501 // The extension should again want to run. Automatically dismiss the bubble 501 // The extension should again want to run. Automatically dismiss the bubble
502 // that pops up prompting for page refresh. 502 // that pops up prompting for page refresh.
503 EXPECT_TRUE(runner->WantsToRun(extension)); 503 EXPECT_TRUE(runner->WantsToRun(extension));
504 EXPECT_EQ("undefined", GetValue(web_contents)); 504 EXPECT_EQ("undefined", GetValue(web_contents));
505 const int next_nav_id = 505 const int next_nav_id =
506 web_contents->GetController().GetLastCommittedEntry()->GetUniqueID(); 506 web_contents->GetController().GetLastCommittedEntry()->GetUniqueID();
507 runner->set_default_bubble_close_action_for_testing( 507 runner->set_default_bubble_close_action_for_testing(
508 base::MakeUnique<ToolbarActionsBarBubbleDelegate::CloseAction>( 508 base::MakeUnique<ToolbarActionsBarBubbleDelegate::CloseAction>(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 554
555 ASSERT_TRUE(embedded_test_server()->Start()); 555 ASSERT_TRUE(embedded_test_server()->Start());
556 ui_test_utils::NavigateToURL( 556 ui_test_utils::NavigateToURL(
557 browser(), embedded_test_server()->GetURL("/extensions/test_file.html")); 557 browser(), embedded_test_server()->GetURL("/extensions/test_file.html"));
558 558
559 for (const auto& tester : testers) 559 for (const auto& tester : testers)
560 EXPECT_TRUE(tester->Verify()) << tester->name(); 560 EXPECT_TRUE(tester->Verify()) << tester->name();
561 } 561 }
562 562
563 } // namespace extensions 563 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_action_runner.cc ('k') | chrome/browser/extensions/navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698