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

Unified Diff: chrome/browser/policy/enterprise_metrics_enrollment_browsertest.cc

Issue 8436002: [cros] Remove Views implementation for login/OOBE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/enterprise_metrics_enrollment_browsertest.cc
diff --git a/chrome/browser/policy/enterprise_metrics_enrollment_browsertest.cc b/chrome/browser/policy/enterprise_metrics_enrollment_browsertest.cc
index 5be20e326098ea6dda462cd2a4bb2be14615c5c4..d3bc17cafe7ec1e0f1e9838678a25f4207872988 100644
--- a/chrome/browser/policy/enterprise_metrics_enrollment_browsertest.cc
+++ b/chrome/browser/policy/enterprise_metrics_enrollment_browsertest.cc
@@ -12,6 +12,8 @@
#include "chrome/browser/policy/enterprise_metrics.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
+#include "content/browser/plugin_service.h"
+#include "content/public/browser/browser_thread.h"
#include "content/test/test_url_fetcher_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,6 +25,16 @@ void assert_handler(const std::string& str) {
LOG(INFO) << "Previous failure was expected, ignoring.";
}
+void QuitMessageLoop() {
+ MessageLoop::current()->Quit();
+}
+
+void OnGetPluginsCallback(const std::vector<webkit::WebPluginInfo>&) {
+ content::BrowserThread::PostTask(content::BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&QuitMessageLoop));
+}
+
} // namespace
class EnterpriseMetricsEnrollmentTest : public WizardInProcessBrowserTest {
@@ -148,6 +160,16 @@ IN_PROC_BROWSER_TEST_F(EnterpriseMetricsEnrollmentTest, EnrollmentOK) {
screen_->OnPolicyStateChanged(policy::CloudPolicySubsystem::SUCCESS,
policy::CloudPolicySubsystem::NO_DETAILS);
CheckSample(policy::kMetricEnrollmentOK);
+
+ // The PluginService might be trying to retrieve information from the
+ // plugin process. Wait until it completes before shutting down.
+ //
+ // During tests the channel to the plugin process may fail to open, and
+ // PluginDataRemover::OnError logs a LOG(DFATAL). The ExpectNOTREACHED here
+ // Prevents this test failing in that case too.
+ ExpectNOTREACHED();
+ PluginService::GetInstance()->GetPlugins(base::Bind(&OnGetPluginsCallback));
+ MessageLoop::current()->Run();
}
IN_PROC_BROWSER_TEST_F(EnterpriseMetricsEnrollmentTest, AuthErrorConnection) {
« no previous file with comments | « chrome/browser/chromeos/status/network_dropdown_button.cc ('k') | chrome/browser/policy/resources/enrollment.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698