Commit fe68e73c authored by thakis@chromium.org's avatar thakis@chromium.org

Revert 88470 (broke ServiceProcessStateTest.ForceShutdown on CrOS) - Fix for...

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
parent 23f785bb
...@@ -94,20 +94,17 @@ void SysInfo::ParseLsbRelease(const std::string& lsb_release, ...@@ -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; size_t length = lsb_release.find_first_of('\n', start_index) - start_index;
std::string version = lsb_release.substr(start_index, length); std::string version = lsb_release.substr(start_index, length);
StringTokenizer tokenizer(version, "."); StringTokenizer tokenizer(version, ".");
// TODO(rkc): Ignore the 0. here; fix this once we move Chrome OS version for (int i = 0; i < 3 && tokenizer.GetNext(); i++) {
// numbers from the 0.xx.yyy.zz format to the xx.yyy.zz format. if (0 == i) {
// 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) {
StringToInt(tokenizer.token_begin(), StringToInt(tokenizer.token_begin(),
tokenizer.token_end(), tokenizer.token_end(),
major_version); major_version);
*minor_version = *bugfix_version = 0; *minor_version = *bugfix_version = 0;
} else if (2 == i) { } else if (1 == i) {
StringToInt(tokenizer.token_begin(), StringToInt(tokenizer.token_begin(),
tokenizer.token_end(), tokenizer.token_end(),
minor_version); minor_version);
} else { // 3 == i } else { // 2 == i
StringToInt(tokenizer.token_begin(), StringToInt(tokenizer.token_begin(),
tokenizer.token_end(), tokenizer.token_end(),
bugfix_version); bugfix_version);
......
// 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -67,9 +67,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) { ...@@ -67,9 +67,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) {
&os_major_version, &os_major_version,
&os_minor_version, &os_minor_version,
&os_bugfix_version); &os_bugfix_version);
EXPECT_EQ(2, os_major_version); EXPECT_EQ(1, os_major_version);
EXPECT_EQ(3, os_minor_version); EXPECT_EQ(2, os_minor_version);
EXPECT_EQ(4, os_bugfix_version); EXPECT_EQ(3, os_bugfix_version);
} }
TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) { TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
...@@ -83,9 +83,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) { ...@@ -83,9 +83,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
&os_major_version, &os_major_version,
&os_minor_version, &os_minor_version,
&os_bugfix_version); &os_bugfix_version);
EXPECT_EQ(2, os_major_version); EXPECT_EQ(1, os_major_version);
EXPECT_EQ(3, os_minor_version); EXPECT_EQ(2, os_minor_version);
EXPECT_EQ(4, os_bugfix_version); EXPECT_EQ(3, os_bugfix_version);
} }
TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) { TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) {
......
...@@ -1239,7 +1239,6 @@ ChromeOSAboutVersionHandler::ChromeOSAboutVersionHandler(AboutSource* source, ...@@ -1239,7 +1239,6 @@ ChromeOSAboutVersionHandler::ChromeOSAboutVersionHandler(AboutSource* source,
int request_id) int request_id)
: source_(source), : source_(source),
request_id_(request_id) { request_id_(request_id) {
loader_.EnablePlatformVersions(true);
loader_.GetVersion(&consumer_, loader_.GetVersion(&consumer_,
NewCallback(this, &ChromeOSAboutVersionHandler::OnVersion), NewCallback(this, &ChromeOSAboutVersionHandler::OnVersion),
chromeos::VersionLoader::VERSION_FULL); chromeos::VersionLoader::VERSION_FULL);
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/views/dom_view.h" #include "chrome/browser/ui/views/dom_view.h"
#include "chrome/browser/ui/views/window.h" #include "chrome/browser/ui/views/window.h"
#include "chrome/common/chrome_version_info.h"
#include "googleurl/src/gurl.h" #include "googleurl/src/gurl.h"
#include "grit/chromium_strings.h" #include "grit/chromium_strings.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
...@@ -48,7 +47,6 @@ using views::Widget; ...@@ -48,7 +47,6 @@ using views::Widget;
namespace { namespace {
const SkColor kVersionColor = 0xff5c739f; const SkColor kVersionColor = 0xff5c739f;
const char kPlatformLabel[] = "cros:";
// Returns the corresponding step id for step constant. // Returns the corresponding step id for step constant.
int GetStepId(size_t step) { int GetStepId(size_t step) {
...@@ -341,11 +339,10 @@ void BackgroundView::InitInfoLabels() { ...@@ -341,11 +339,10 @@ void BackgroundView::InitInfoLabels() {
} }
if (CrosLibrary::Get()->EnsureLoaded()) { if (CrosLibrary::Get()->EnsureLoaded()) {
version_loader_.EnablePlatformVersions(true);
version_loader_.GetVersion( version_loader_.GetVersion(
&version_consumer_, &version_consumer_,
NewCallback(this, &BackgroundView::OnVersion), NewCallback(this, &BackgroundView::OnVersion),
is_official_build_ ? is_official_build_?
VersionLoader::VERSION_SHORT_WITH_DATE : VersionLoader::VERSION_SHORT_WITH_DATE :
VersionLoader::VERSION_FULL); VersionLoader::VERSION_FULL);
if (!is_official_build_) { if (!is_official_build_) {
...@@ -408,18 +405,12 @@ void BackgroundView::UpdateVersionLabel() { ...@@ -408,18 +405,12 @@ void BackgroundView::UpdateVersionLabel() {
if (version_text_.empty()) if (version_text_.empty())
return; return;
chrome::VersionInfo version_info; // TODO(jungshik): Is string concatenation OK here?
std::string label_text = l10n_util::GetStringUTF8(IDS_PRODUCT_NAME); std::string label_text = l10n_util::GetStringUTF8(IDS_PRODUCT_OS_NAME);
label_text += ' '; label_text += ' ';
label_text += version_info.Version(); label_text += l10n_util::GetStringUTF8(IDS_VERSION_FIELD_PREFIX);
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 += ' '; label_text += ' ';
label_text += version_text_; label_text += version_text_;
label_text += ')';
if (!enterprise_domain_text_.empty()) { if (!enterprise_domain_text_.empty()) {
label_text += ' '; label_text += ' ';
......
// 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -21,10 +21,6 @@ namespace chromeos { ...@@ -21,10 +21,6 @@ namespace chromeos {
// File to look for version number in. // File to look for version number in.
static const char kPathVersion[] = "/etc/lsb-release"; 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. // File to look for firmware number in.
static const char kPathFirmware[] = "/var/log/bios_info.txt"; static const char kPathFirmware[] = "/var/log/bios_info.txt";
...@@ -82,10 +78,6 @@ VersionLoader::Handle VersionLoader::GetFirmware( ...@@ -82,10 +78,6 @@ VersionLoader::Handle VersionLoader::GetFirmware(
return request->handle(); return request->handle();
} }
void VersionLoader::EnablePlatformVersions(bool enable) {
backend_.get()->set_parse_as_platform(enable);
}
// static // static
std::string VersionLoader::ParseVersion(const std::string& contents, std::string VersionLoader::ParseVersion(const std::string& contents,
const std::string& prefix) { const std::string& prefix) {
...@@ -147,20 +139,6 @@ void VersionLoader::Backend::GetVersion( ...@@ -147,20 +139,6 @@ void VersionLoader::Backend::GetVersion(
version = ParseVersion( version = ParseVersion(
contents, contents,
(format == VERSION_FULL) ? kFullVersionPrefix : kVersionPrefix); (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) { if (format == VERSION_SHORT_WITH_DATE) {
......
...@@ -59,12 +59,6 @@ class VersionLoader : public CancelableRequestProvider { ...@@ -59,12 +59,6 @@ class VersionLoader : public CancelableRequestProvider {
Handle GetFirmware(CancelableRequestConsumerBase* consumer, Handle GetFirmware(CancelableRequestConsumerBase* consumer,
GetFirmwareCallback* callback); 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 kFullVersionPrefix[];
static const char kVersionPrefix[]; static const char kVersionPrefix[];
static const char kFirmwarePrefix[]; static const char kFirmwarePrefix[];
...@@ -78,7 +72,7 @@ class VersionLoader : public CancelableRequestProvider { ...@@ -78,7 +72,7 @@ class VersionLoader : public CancelableRequestProvider {
// and extract the version. // and extract the version.
class Backend : public base::RefCountedThreadSafe<Backend> { class Backend : public base::RefCountedThreadSafe<Backend> {
public: public:
Backend() : parse_as_platform_(false) {} Backend() {}
// Calls ParseVersion to get the version # and notifies request. // Calls ParseVersion to get the version # and notifies request.
// This is invoked on the file thread. // This is invoked on the file thread.
...@@ -90,13 +84,9 @@ class VersionLoader : public CancelableRequestProvider { ...@@ -90,13 +84,9 @@ class VersionLoader : public CancelableRequestProvider {
// This is invoked on the file thread. // This is invoked on the file thread.
void GetFirmware(scoped_refptr<GetFirmwareRequest> request); void GetFirmware(scoped_refptr<GetFirmwareRequest> request);
void set_parse_as_platform(bool value) { parse_as_platform_ = value; }
private: private:
friend class base::RefCountedThreadSafe<Backend>; friend class base::RefCountedThreadSafe<Backend>;
bool parse_as_platform_;
~Backend() {} ~Backend() {}
DISALLOW_COPY_AND_ASSIGN(Backend); DISALLOW_COPY_AND_ASSIGN(Backend);
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
<section> <section>
<div> <div>
<!-- White space is significant between spans. --> <!-- 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> <div>
<span i18n-content="browser"></span> <span i18n-content="browser"></span>
<span i18n-content="browser_version"></span> <span i18n-content="browser_version"></span>
</div> </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> <div>
<button id="moreInfoButton" class="link-button" <button id="moreInfoButton" class="link-button"
i18n-content="more_info"></button> i18n-content="more_info"></button>
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
</div> </div>
</section> </section>
<section> <section>
<h3 i18n-content="browser"></h3> <h3 i18n-content="firmware"></h3>
<div i18n-content="browser_version"></div> <div id="osFirmware1">
<span class="loading" i18n-content="loading"></span>
</section> </section>
<section> <section>
<h3 i18n-content="os"></h3> <h3 i18n-content="os"></h3>
...@@ -45,9 +46,8 @@ ...@@ -45,9 +46,8 @@
</div> </div>
</section> </section>
<section> <section>
<h3 i18n-content="firmware"></h3> <h3 i18n-content="browser"></h3>
<div id="osFirmware1"> <div i18n-content="browser_version"></div>
<span class="loading" i18n-content="loading"></span>
</section> </section>
<section> <section>
<h3>WebKit</h3> <h3>WebKit</h3>
......
...@@ -271,7 +271,6 @@ void AboutPageHandler::RegisterMessages() { ...@@ -271,7 +271,6 @@ void AboutPageHandler::RegisterMessages() {
void AboutPageHandler::PageReady(const ListValue* args) { void AboutPageHandler::PageReady(const ListValue* args) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
// Version information is loaded from a callback // Version information is loaded from a callback
loader_.EnablePlatformVersions(true);
loader_.GetVersion(&consumer_, loader_.GetVersion(&consumer_,
NewCallback(this, &AboutPageHandler::OnOSVersion), NewCallback(this, &AboutPageHandler::OnOSVersion),
chromeos::VersionLoader::VERSION_FULL); chromeos::VersionLoader::VERSION_FULL);
......
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