diff options
author | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 21:04:24 +0000 |
---|---|---|
committer | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 21:04:24 +0000 |
commit | 6a92c40fa37885c89d805ee0054e46666b865f89 (patch) | |
tree | 822afe1c7c2cc79fba603eaca4ec803e96555b62 /chrome/browser/tab_restore_uitest.cc | |
parent | bcd9b147d7622c7d8b0970142254bfe94d10cb5f (diff) | |
download | chromium_src-6a92c40fa37885c89d805ee0054e46666b865f89.zip chromium_src-6a92c40fa37885c89d805ee0054e46666b865f89.tar.gz chromium_src-6a92c40fa37885c89d805ee0054e46666b865f89.tar.bz2 |
Weaken is_active check more, since it appears that Chromium can switch to and
from being the frontmost app during the course of a ui_tests run. This way
errors will show up in more carefully controlled local tests, but won't turn
the bots red.
BUG=5278
TEST=make sure TabRestoreUiTest.* don't fail due to is_active being false
Review URL: http://codereview.chromium.org/92038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_restore_uitest.cc')
-rw-r--r-- | chrome/browser/tab_restore_uitest.cc | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc index af98b5c..c3089fe 100644 --- a/chrome/browser/tab_restore_uitest.cc +++ b/chrome/browser/tab_restore_uitest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -105,24 +105,13 @@ class TabRestoreUITest : public UITest { bool is_active = false; scoped_ptr<WindowProxy> window_proxy(browser->GetWindow()); ASSERT_TRUE(window_proxy->IsActive(&is_active)); - // The EXPECT_TRUE may fail if other apps are active while running the - // tests, because Chromium won't be the foremost application at all. To - // prevent this from turning the buildbots red, we disable the check - // entirely if it failed the first time we tried it. Thus the first - // CheckActiveWindow() call we encounter should be in a situation that's - // virtually guaranteed to be correct. - static int check_flag = 0; // 0 = first run, -1 = don't check, 1 = do check - if (!check_flag) { - if (is_active) { - check_flag = 1; - } else { - check_flag = -1; - LOG(ERROR) << "CheckActiveWindow disabled for all TabRestoreUITest.*" - " because Chromium is not the front app."; - } - } - if (check_flag == 1) - EXPECT_TRUE(is_active); + // The check for is_active may fail if other apps are active while running + // the tests, because Chromium won't be the foremost application at all. + // So we'll have it log an error, but not report one through gtest, to + // keep the test result deterministic and the buildbots happy. + if (!is_active) + LOG(ERROR) << "WARNING: is_active was false, expected true. (This may " + "be simply because Chromium isn't the front application.)"; } GURL url1_; |