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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 } | 2639 } |
2640 }; | 2640 }; |
2641 | 2641 |
2642 IN_PROC_BROWSER_TEST_F(PolicyStatisticsCollectorTest, Startup) { | 2642 IN_PROC_BROWSER_TEST_F(PolicyStatisticsCollectorTest, Startup) { |
2643 // Verifies that policy usage histograms are collected at startup. | 2643 // Verifies that policy usage histograms are collected at startup. |
2644 | 2644 |
2645 // BrowserPolicyConnector::Init() has already been called. Make sure the | 2645 // BrowserPolicyConnector::Init() has already been called. Make sure the |
2646 // CompleteInitialization() task has executed as well. | 2646 // CompleteInitialization() task has executed as well. |
2647 content::RunAllPendingInMessageLoop(); | 2647 content::RunAllPendingInMessageLoop(); |
2648 | 2648 |
2649 GURL kAboutHistograms = GURL(std::string(chrome::kAboutScheme) + | 2649 GURL kAboutHistograms = GURL(std::string(content::kAboutScheme) + |
2650 std::string(content::kStandardSchemeSeparator) + | 2650 std::string(content::kStandardSchemeSeparator) + |
2651 std::string(content::kChromeUIHistogramHost)); | 2651 std::string(content::kChromeUIHistogramHost)); |
2652 ui_test_utils::NavigateToURL(browser(), kAboutHistograms); | 2652 ui_test_utils::NavigateToURL(browser(), kAboutHistograms); |
2653 content::WebContents* contents = | 2653 content::WebContents* contents = |
2654 browser()->tab_strip_model()->GetActiveWebContents(); | 2654 browser()->tab_strip_model()->GetActiveWebContents(); |
2655 std::string text; | 2655 std::string text; |
2656 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2656 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2657 contents, | 2657 contents, |
2658 "var nodes = document.querySelectorAll('body > pre');" | 2658 "var nodes = document.querySelectorAll('body > pre');" |
2659 "var result = '';" | 2659 "var result = '';" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 PrefService* prefs = browser()->profile()->GetPrefs(); | 2976 PrefService* prefs = browser()->profile()->GetPrefs(); |
2977 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2977 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( |
2978 prefs, "host.name")); | 2978 prefs, "host.name")); |
2979 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( | 2979 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( |
2980 prefs, "other.host.name")); | 2980 prefs, "other.host.name")); |
2981 } | 2981 } |
2982 | 2982 |
2983 #endif // !defined(CHROME_OS) | 2983 #endif // !defined(CHROME_OS) |
2984 | 2984 |
2985 } // namespace policy | 2985 } // namespace policy |
OLD | NEW |