diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-09 17:24:38 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-09 17:24:38 +0000 |
commit | fe68e73c53268cdc6eb0c65adea5dda75d9281ab (patch) | |
tree | 95da60b91748131807fce7df8b8ae147baca89fa | |
parent | 23f785bb901f960bb8481ff93b3294e6700b827c (diff) | |
download | chromium_src-fe68e73c53268cdc6eb0c65adea5dda75d9281ab.zip chromium_src-fe68e73c53268cdc6eb0c65adea5dda75d9281ab.tar.gz chromium_src-fe68e73c53268cdc6eb0c65adea5dda75d9281ab.tar.bz2 |
Revert 88470 (broke ServiceProcessStateTest.ForceShutdown on CrOS) - Fix for system version unit tests in cros.
BUG=chromium-os:15789
TEST=Ran try servers to make sure the unit test is not failing anymore, plus viewed all the screens and took screenshots. Screen shots of all effected screens are attached to the cros bug
TBR=rkc@chromium.org
TBR=rkc@chromium.org
Review URL: http://codereview.chromium.org/7044086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88545 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/sys_info_chromeos.cc | 11 | ||||
-rw-r--r-- | base/sys_info_unittest.cc | 14 | ||||
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 1 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/background_view.cc | 17 | ||||
-rw-r--r-- | chrome/browser/chromeos/version_loader.cc | 24 | ||||
-rw-r--r-- | chrome/browser/chromeos/version_loader.h | 12 | ||||
-rw-r--r-- | chrome/browser/resources/options/about_page.html | 18 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/about_page_handler.cc | 1 |
8 files changed, 26 insertions, 72 deletions
diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc index f724f99..cd17c18 100644 --- a/base/sys_info_chromeos.cc +++ b/base/sys_info_chromeos.cc @@ -94,20 +94,17 @@ void SysInfo::ParseLsbRelease(const std::string& lsb_release, size_t length = lsb_release.find_first_of('\n', start_index) - start_index; std::string version = lsb_release.substr(start_index, length); StringTokenizer tokenizer(version, "."); - // TODO(rkc): Ignore the 0. here; fix this once we move Chrome OS version - // numbers from the 0.xx.yyy.zz format to the xx.yyy.zz format. - // Refer to http://code.google.com/p/chromium-os/issues/detail?id=15789 - for (int i = 0; i < 4 && tokenizer.GetNext(); i++) { - if (1 == i) { + for (int i = 0; i < 3 && tokenizer.GetNext(); i++) { + if (0 == i) { StringToInt(tokenizer.token_begin(), tokenizer.token_end(), major_version); *minor_version = *bugfix_version = 0; - } else if (2 == i) { + } else if (1 == i) { StringToInt(tokenizer.token_begin(), tokenizer.token_end(), minor_version); - } else { // 3 == i + } else { // 2 == i StringToInt(tokenizer.token_begin(), tokenizer.token_end(), bugfix_version); diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc index 06f21cc..3e51890 100644 --- a/base/sys_info_unittest.cc +++ b/base/sys_info_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -67,9 +67,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) { &os_major_version, &os_minor_version, &os_bugfix_version); - EXPECT_EQ(2, os_major_version); - EXPECT_EQ(3, os_minor_version); - EXPECT_EQ(4, os_bugfix_version); + EXPECT_EQ(1, os_major_version); + EXPECT_EQ(2, os_minor_version); + EXPECT_EQ(3, os_bugfix_version); } TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) { @@ -83,9 +83,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) { &os_major_version, &os_minor_version, &os_bugfix_version); - EXPECT_EQ(2, os_major_version); - EXPECT_EQ(3, os_minor_version); - EXPECT_EQ(4, os_bugfix_version); + EXPECT_EQ(1, os_major_version); + EXPECT_EQ(2, os_minor_version); + EXPECT_EQ(3, os_bugfix_version); } TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) { diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index e9f9cea..f26d0b1 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -1239,7 +1239,6 @@ ChromeOSAboutVersionHandler::ChromeOSAboutVersionHandler(AboutSource* source, int request_id) : source_(source), request_id_(request_id) { - loader_.EnablePlatformVersions(true); loader_.GetVersion(&consumer_, NewCallback(this, &ChromeOSAboutVersionHandler::OnVersion), chromeos::VersionLoader::VERSION_FULL); diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc index 80bd3c7..f43c7ca 100644 --- a/chrome/browser/chromeos/login/background_view.cc +++ b/chrome/browser/chromeos/login/background_view.cc @@ -28,7 +28,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/views/dom_view.h" #include "chrome/browser/ui/views/window.h" -#include "chrome/common/chrome_version_info.h" #include "googleurl/src/gurl.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -48,7 +47,6 @@ using views::Widget; namespace { const SkColor kVersionColor = 0xff5c739f; -const char kPlatformLabel[] = "cros:"; // Returns the corresponding step id for step constant. int GetStepId(size_t step) { @@ -341,11 +339,10 @@ void BackgroundView::InitInfoLabels() { } if (CrosLibrary::Get()->EnsureLoaded()) { - version_loader_.EnablePlatformVersions(true); version_loader_.GetVersion( &version_consumer_, NewCallback(this, &BackgroundView::OnVersion), - is_official_build_ ? + is_official_build_? VersionLoader::VERSION_SHORT_WITH_DATE : VersionLoader::VERSION_FULL); if (!is_official_build_) { @@ -408,18 +405,12 @@ void BackgroundView::UpdateVersionLabel() { if (version_text_.empty()) return; - chrome::VersionInfo version_info; - std::string label_text = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); + // TODO(jungshik): Is string concatenation OK here? + std::string label_text = l10n_util::GetStringUTF8(IDS_PRODUCT_OS_NAME); label_text += ' '; - label_text += version_info.Version(); - label_text += " ("; - // TODO(rkc): Fix this. This needs to be in a resource file, but we have had - // to put it in for merge into R12. Also, look at rtl implications for this - // entire string composition code. - label_text += kPlatformLabel; + label_text += l10n_util::GetStringUTF8(IDS_VERSION_FIELD_PREFIX); label_text += ' '; label_text += version_text_; - label_text += ')'; if (!enterprise_domain_text_.empty()) { label_text += ' '; diff --git a/chrome/browser/chromeos/version_loader.cc b/chrome/browser/chromeos/version_loader.cc index 45b0a60..17981ab 100644 --- a/chrome/browser/chromeos/version_loader.cc +++ b/chrome/browser/chromeos/version_loader.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -21,10 +21,6 @@ namespace chromeos { // File to look for version number in. static const char kPathVersion[] = "/etc/lsb-release"; -// TODO(rkc): Remove once we change over the Chrome OS version format. -// Done for http://code.google.com/p/chromium-os/issues/detail?id=15789 -static const size_t kTrimVersion = 2; - // File to look for firmware number in. static const char kPathFirmware[] = "/var/log/bios_info.txt"; @@ -82,10 +78,6 @@ VersionLoader::Handle VersionLoader::GetFirmware( return request->handle(); } -void VersionLoader::EnablePlatformVersions(bool enable) { - backend_.get()->set_parse_as_platform(enable); -} - // static std::string VersionLoader::ParseVersion(const std::string& contents, const std::string& prefix) { @@ -147,20 +139,6 @@ void VersionLoader::Backend::GetVersion( version = ParseVersion( contents, (format == VERSION_FULL) ? kFullVersionPrefix : kVersionPrefix); - - // TODO(rkc): Fix this once we move to xx.yyy version numbers for Chrome OS - // instead of 0.xx.yyy - // Done for http://code.google.com/p/chromium-os/issues/detail?id=15789 - if (parse_as_platform_) { - if (version.size() > kTrimVersion) { - version = version.substr(kTrimVersion); - // Strip the major version. - size_t first_dot = version.find("."); - if (first_dot != std::string::npos) { - version = version.substr(first_dot + 1); - } - } - } } if (format == VERSION_SHORT_WITH_DATE) { diff --git a/chrome/browser/chromeos/version_loader.h b/chrome/browser/chromeos/version_loader.h index bf90bc8..219cd3a 100644 --- a/chrome/browser/chromeos/version_loader.h +++ b/chrome/browser/chromeos/version_loader.h @@ -59,12 +59,6 @@ class VersionLoader : public CancelableRequestProvider { Handle GetFirmware(CancelableRequestConsumerBase* consumer, GetFirmwareCallback* callback); - // Parse the version information as a Chrome platfrom, not Chrome OS - // TODO(rkc): Change this and everywhere it is used once we switch Chrome OS - // over to xx.yyy.zz version numbers instead of 0.xx.yyy.zz - // Refer to http://code.google.com/p/chromium-os/issues/detail?id=15789 - void EnablePlatformVersions(bool enable); - static const char kFullVersionPrefix[]; static const char kVersionPrefix[]; static const char kFirmwarePrefix[]; @@ -78,7 +72,7 @@ class VersionLoader : public CancelableRequestProvider { // and extract the version. class Backend : public base::RefCountedThreadSafe<Backend> { public: - Backend() : parse_as_platform_(false) {} + Backend() {} // Calls ParseVersion to get the version # and notifies request. // This is invoked on the file thread. @@ -90,13 +84,9 @@ class VersionLoader : public CancelableRequestProvider { // This is invoked on the file thread. void GetFirmware(scoped_refptr<GetFirmwareRequest> request); - void set_parse_as_platform(bool value) { parse_as_platform_ = value; } - private: friend class base::RefCountedThreadSafe<Backend>; - bool parse_as_platform_; - ~Backend() {} DISALLOW_COPY_AND_ASSIGN(Backend); diff --git a/chrome/browser/resources/options/about_page.html b/chrome/browser/resources/options/about_page.html index fbecd92..05baa8d 100644 --- a/chrome/browser/resources/options/about_page.html +++ b/chrome/browser/resources/options/about_page.html @@ -4,14 +4,14 @@ <section> <div> <!-- White space is significant between spans. --> + <div><span i18n-content="firmware"></span> <span id="osFirmware0"> + <span class="loading" i18n-content="loading"></span></span></div> + <div><span i18n-content="os"></span> <span id="osVersion0"> + <span class="loading" i18n-content="loading"></span></span></div> <div> <span i18n-content="browser"></span> <span i18n-content="browser_version"></span> </div> - <div><span i18n-content="os"></span> <span id="osVersion0"> - <span class="loading" i18n-content="loading"></span></span></div> - <div><span i18n-content="firmware"></span> <span id="osFirmware0"> - <span class="loading" i18n-content="loading"></span></span></div> <div> <button id="moreInfoButton" class="link-button" i18n-content="more_info"></button> @@ -35,8 +35,9 @@ </div> </section> <section> - <h3 i18n-content="browser"></h3> - <div i18n-content="browser_version"></div> + <h3 i18n-content="firmware"></h3> + <div id="osFirmware1"> + <span class="loading" i18n-content="loading"></span> </section> <section> <h3 i18n-content="os"></h3> @@ -45,9 +46,8 @@ </div> </section> <section> - <h3 i18n-content="firmware"></h3> - <div id="osFirmware1"> - <span class="loading" i18n-content="loading"></span> + <h3 i18n-content="browser"></h3> + <div i18n-content="browser_version"></div> </section> <section> <h3>WebKit</h3> diff --git a/chrome/browser/ui/webui/options/about_page_handler.cc b/chrome/browser/ui/webui/options/about_page_handler.cc index 988ed81..04f43b4 100644 --- a/chrome/browser/ui/webui/options/about_page_handler.cc +++ b/chrome/browser/ui/webui/options/about_page_handler.cc @@ -271,7 +271,6 @@ void AboutPageHandler::RegisterMessages() { void AboutPageHandler::PageReady(const ListValue* args) { #if defined(OS_CHROMEOS) // Version information is loaded from a callback - loader_.EnablePlatformVersions(true); loader_.GetVersion(&consumer_, NewCallback(this, &AboutPageHandler::OnOSVersion), chromeos::VersionLoader::VERSION_FULL); |