| Index: chrome_frame/test/chrome_frame_test_utils.cc
|
| diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
|
| index d8d1e133b3d0a6dd05166e0eddfd76f72a04ceb1..ecc95d5acd057d505a02683db8661a88bcf2b998 100644
|
| --- a/chrome_frame/test/chrome_frame_test_utils.cc
|
| +++ b/chrome_frame/test/chrome_frame_test_utils.cc
|
| @@ -19,6 +19,8 @@
|
| #include "base/path_service.h"
|
| #include "base/process.h"
|
| #include "base/process_util.h"
|
| +#include "base/string_number_conversions.h"
|
| +#include "base/string_piece.h"
|
| #include "base/string_util.h"
|
| #include "base/stringprintf.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -420,19 +422,27 @@ std::wstring GetExeVersion(const std::wstring& exe_path) {
|
| }
|
|
|
| IEVersion GetInstalledIEVersion() {
|
| - std::wstring path = chrome_frame_test::GetExecutableAppPath(kIEImageName);
|
| - std::wstring version = GetExeVersion(path);
|
| -
|
| - switch (version[0]) {
|
| - case '6':
|
| + std::wstring path(chrome_frame_test::GetExecutableAppPath(kIEImageName));
|
| + std::wstring version(GetExeVersion(path));
|
| + size_t first_dot = version.find(L'.');
|
| + int major_version = 0;
|
| + if (!base::StringToInt(base::StringPiece16(
|
| + version.data(),
|
| + first_dot == std::wstring::npos ? version.size() : first_dot),
|
| + &major_version)) {
|
| + return IE_UNSUPPORTED;
|
| + }
|
| +
|
| + switch (major_version) {
|
| + case 6:
|
| return IE_6;
|
| - case '7':
|
| + case 7:
|
| return IE_7;
|
| - case '8':
|
| + case 8:
|
| return IE_8;
|
| - case '9':
|
| + case 9:
|
| return IE_9;
|
| - case '10':
|
| + case 10:
|
| return IE_10;
|
| default:
|
| break;
|
|
|