Commit f3eccd0d authored by dzhioev@chromium.org's avatar dzhioev@chromium.org

Prevented flakiness in FirstRunUIBrowserTest.FirstRunFlow test.

BUG=335280
TEST=browser_test --gtest_filter=FirstRunUIBrowserTest.FirstRunFlow

Review URL: https://codereview.chromium.org/141803002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245561 0039d316-1c4b-4281-b951-d872f2087c98
parent c721e572
...@@ -35,6 +35,7 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest, ...@@ -35,6 +35,7 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest,
} }
virtual void OnStepShown(const std::string& step_name) OVERRIDE { virtual void OnStepShown(const std::string& step_name) OVERRIDE {
current_step_name_ = step_name;
if (!on_step_shown_callback_.is_null()) if (!on_step_shown_callback_.is_null())
on_step_shown_callback_.Run(); on_step_shown_callback_.Run();
controller()->OnStepShown(step_name); controller()->OnStepShown(step_name);
...@@ -77,10 +78,10 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest, ...@@ -77,10 +78,10 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest,
} }
void WaitForStep(const std::string& step_name) { void WaitForStep(const std::string& step_name) {
if (GetCurrentStepName() == step_name) if (current_step_name_ == step_name)
return; return;
WaitUntilCalled(&on_step_shown_callback_); WaitUntilCalled(&on_step_shown_callback_);
EXPECT_EQ(GetCurrentStepName(), step_name); EXPECT_EQ(current_step_name_, step_name);
} }
void AdvanceStep() { void AdvanceStep() {
...@@ -102,11 +103,6 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest, ...@@ -102,11 +103,6 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest,
callback->Reset(); callback->Reset();
} }
std::string GetCurrentStepName() {
return js().GetString(
"cr.FirstRun.currentStep_ ? cr.FirstRun.currentStep_.getName() : ''");
}
test::JSChecker& js() { return js_; } test::JSChecker& js() { return js_; }
ash::FirstRunHelper* shell_helper() { ash::FirstRunHelper* shell_helper() {
...@@ -118,6 +114,7 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest, ...@@ -118,6 +114,7 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest,
} }
private: private:
std::string current_step_name_;
bool initialized_; bool initialized_;
bool finalized_; bool finalized_;
base::Closure on_initialized_callback_; base::Closure on_initialized_callback_;
...@@ -126,8 +123,7 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest, ...@@ -126,8 +123,7 @@ class FirstRunUIBrowserTest : public InProcessBrowserTest,
test::JSChecker js_; test::JSChecker js_;
}; };
// Disabled due to flakiness, see http://crbug.com/335280 IN_PROC_BROWSER_TEST_F(FirstRunUIBrowserTest, FirstRunFlow) {
IN_PROC_BROWSER_TEST_F(FirstRunUIBrowserTest, DISABLED_FirstRunFlow) {
LaunchTutorial(); LaunchTutorial();
WaitForInitialization(); WaitForInitialization();
WaitForStep(first_run::kAppListStep); WaitForStep(first_run::kAppListStep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment