diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-29 22:18:01 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-29 22:18:01 +0000 |
commit | 05f9b688e319fcb092be0e06f7b72d39dd3113b3 (patch) | |
tree | 6d24be7f9b788bbebbff6b2349e51dec49034ce6 /chrome/test | |
parent | 86ec30d6710923cf1c193eb88b1e6251f831e0ef (diff) | |
download | chromium_src-05f9b688e319fcb092be0e06f7b72d39dd3113b3.zip chromium_src-05f9b688e319fcb092be0e06f7b72d39dd3113b3.tar.gz chromium_src-05f9b688e319fcb092be0e06f7b72d39dd3113b3.tar.bz2 |
Refactoring for portability:
- Move chrome/common/env_util to base/sys_info
- Move chrome/common/rand_util to base/rand_util (new), simplify its public
interface, and fix its implementation
Patch by Paweł Hajdan, Jr. <phajdan.jr@gmail.com>
http://codereview.chromium.org/4079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2697 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_tests.cc | 14 | ||||
-rw-r--r-- | chrome/test/selenium/selenium_test.cc | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 694ad4e..7372030 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -7,13 +7,13 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/path_service.h" +#include "base/rand_util.h" #include "base/string_util.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/view_ids.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/libxml_utils.h" -#include "chrome/common/rand_util.h" #include "chrome/common/win_util.h" #include "chrome/test/automated_ui_tests/automated_ui_tests.h" #include "chrome/test/automation/browser_proxy.h" @@ -421,9 +421,9 @@ bool AutomatedUITest::ChangeEncoding() { // The vector will contain mostly IDC values for encoding commands plus a few // menu separators (0 values). If we hit a separator we just retry. - int index = rand_util::RandInt(0, len); + int index = base::RandInt(0, len); while ((*encoding_ids)[index] == 0) { - index = rand_util::RandInt(0, len); + index = base::RandInt(0, len); } return RunCommand((*encoding_ids)[index]); @@ -690,7 +690,7 @@ bool AutomatedUITest::TestViewPasswords() { } bool AutomatedUITest::ExerciseDialog() { - int index = rand_util::RandInt(0, arraysize(kDialogs) - 1); + int index = base::RandInt(0, arraysize(kDialogs) - 1); return DoAction(kDialogs[index]) && FuzzyTestDialog(kTestDialogActionsToRun); } @@ -703,9 +703,9 @@ bool AutomatedUITest::FuzzyTestDialog(int num_actions) { // and Enter would close the dialog without performing more actions. We // rely on the fact that those two actions are first in the array and set // the lower bound to 2 if i == 0 to skip those two actions. - int action_index = rand_util::RandInt(i == 0 ? 2 : 0, - arraysize(kTestDialogPossibleActions) - - 1); + int action_index = base::RandInt(i == 0 ? 2 : 0, + arraysize(kTestDialogPossibleActions) + - 1); return_value = return_value && DoAction(kTestDialogPossibleActions[action_index]); if (DidCrash(false)) diff --git a/chrome/test/selenium/selenium_test.cc b/chrome/test/selenium/selenium_test.cc index 6bfc72f..a1d8a09 100644 --- a/chrome/test/selenium/selenium_test.cc +++ b/chrome/test/selenium/selenium_test.cc @@ -14,9 +14,9 @@ #include "base/file_util.h" #include "base/path_service.h" +#include "base/rand_util.h" #include "base/string_util.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/rand_util.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" @@ -88,7 +88,7 @@ class SeleniumTest : public UITest { L"5.selectFrame,6.click,13.verifyLocation,13.verifyLocation,13.click,24.selectAndWait,24.verifyTitle", L"5.selectFrame,6.click,24.selectAndWait" }; - *failed = kBogusFailures[rand_util::RandInt(0, 2)]; + *failed = kBogusFailures[base::RandInt(0, 2)]; #else std::wstring test_path; PathService::Get(chrome::DIR_TEST_DATA, &test_path); |