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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
10 #include "chrome/browser/infobars/infobar.h" | 10 #include "chrome/browser/infobars/infobar.h" |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 581 |
582 ActOnInterstitialAndInfobar(tab, INTERSTITIAL_PROCEED, INFOBAR_ACCEPT); | 582 ActOnInterstitialAndInfobar(tab, INTERSTITIAL_PROCEED, INFOBAR_ACCEPT); |
583 | 583 |
584 EXPECT_EQ(ManagedUserService::MANUAL_NONE, | 584 EXPECT_EQ(ManagedUserService::MANUAL_NONE, |
585 managed_user_service_->GetManualBehaviorForHost("www.example.com")); | 585 managed_user_service_->GetManualBehaviorForHost("www.example.com")); |
586 EXPECT_EQ(ManagedUserService::MANUAL_ALLOW, | 586 EXPECT_EQ(ManagedUserService::MANUAL_ALLOW, |
587 managed_user_service_->GetManualBehaviorForHost( | 587 managed_user_service_->GetManualBehaviorForHost( |
588 "www.new-example.com")); | 588 "www.new-example.com")); |
589 } | 589 } |
590 | 590 |
| 591 #if !defined(OS_CHROMEOS) |
591 // Now check that the passphrase dialog is shown when a passphrase is specified | 592 // Now check that the passphrase dialog is shown when a passphrase is specified |
592 // and the user clicks on the preview button. | 593 // and the user clicks on the preview button. |
593 IN_PROC_BROWSER_TEST_F(ManagedModeBlockModeTest, | 594 IN_PROC_BROWSER_TEST_F(ManagedModeBlockModeTest, |
594 PreviewAuthenticationRequired) { | 595 PreviewAuthenticationRequired) { |
595 // Set a passphrase. | 596 // Set a passphrase. |
596 PrefService* pref_service = browser()->profile()->GetPrefs(); | 597 PrefService* pref_service = browser()->profile()->GetPrefs(); |
597 pref_service->SetString(prefs::kManagedModeLocalPassphrase, "test"); | 598 pref_service->SetString(prefs::kManagedModeLocalPassphrase, "test"); |
598 | 599 |
599 // Navigate to an URL which should be blocked. | 600 // Navigate to an URL which should be blocked. |
600 GURL test_url("http://www.example.com/files/simple.html"); | 601 GURL test_url("http://www.example.com/files/simple.html"); |
601 ui_test_utils::NavigateToURL(browser(), test_url); | 602 ui_test_utils::NavigateToURL(browser(), test_url); |
602 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 603 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
603 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); | 604 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); |
604 | 605 |
605 // Get the ManagedModeInterstitial delegate. | 606 // Get the ManagedModeInterstitial delegate. |
606 content::InterstitialPageDelegate* delegate = | 607 content::InterstitialPageDelegate* delegate = |
607 interstitial_page->GetDelegateForTesting(); | 608 interstitial_page->GetDelegateForTesting(); |
608 | 609 |
609 // Simulate the click on the "preview" button. | 610 // Simulate the click on the "preview" button. |
610 delegate->CommandReceived("\"preview\""); | 611 delegate->CommandReceived("\"preview\""); |
611 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 612 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
612 WebContentsModalDialogManager::FromWebContents(tab); | 613 WebContentsModalDialogManager::FromWebContents(tab); |
613 EXPECT_TRUE(web_contents_modal_dialog_manager->IsShowingDialog()); | 614 EXPECT_TRUE(web_contents_modal_dialog_manager->IsShowingDialog()); |
614 } | 615 } |
615 | 616 |
| 617 #endif // OS_CHROMEOS |
| 618 |
616 } // namespace | 619 } // namespace |
OLD | NEW |