OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/apps/drive/drive_app_converter.h" | 5 #include "chrome/browser/apps/drive/drive_app_converter.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 const char kAppUrl[] = "http://foobar.com/drive_app"; | 35 const char kAppUrl[] = "http://foobar.com/drive_app"; |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 class DriveAppConverterTest : public ExtensionBrowserTest { | 39 class DriveAppConverterTest : public ExtensionBrowserTest { |
40 public: | 40 public: |
41 DriveAppConverterTest() {} | 41 DriveAppConverterTest() {} |
42 virtual ~DriveAppConverterTest() {} | 42 virtual ~DriveAppConverterTest() {} |
43 | 43 |
44 // ExtensionBrowserTest: | 44 // ExtensionBrowserTest: |
45 virtual void SetUpOnMainThread() OVERRIDE { | 45 virtual void SetUpOnMainThread() override { |
46 ExtensionBrowserTest::SetUpOnMainThread(); | 46 ExtensionBrowserTest::SetUpOnMainThread(); |
47 | 47 |
48 base::FilePath test_data_dir; | 48 base::FilePath test_data_dir; |
49 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 49 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
50 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 50 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
51 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 51 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
52 } | 52 } |
53 | 53 |
54 void InstallAndWaitFinish(const drive::DriveAppInfo& drive_app) { | 54 void InstallAndWaitFinish(const drive::DriveAppInfo& drive_app) { |
55 runner_ = new content::MessageLoopRunner; | 55 runner_ = new content::MessageLoopRunner; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 InstallAndWaitFinish(GetTestDriveApp()); | 150 InstallAndWaitFinish(GetTestDriveApp()); |
151 const Extension* second_install = converter()->extension(); | 151 const Extension* second_install = converter()->extension(); |
152 ASSERT_TRUE(second_install != NULL); | 152 ASSERT_TRUE(second_install != NULL); |
153 EXPECT_FALSE(converter()->is_new_install()); | 153 EXPECT_FALSE(converter()->is_new_install()); |
154 | 154 |
155 // Two different app instances. | 155 // Two different app instances. |
156 ASSERT_NE(first_install, second_install); | 156 ASSERT_NE(first_install, second_install); |
157 EXPECT_EQ(first_install_id, second_install->id()); | 157 EXPECT_EQ(first_install_id, second_install->id()); |
158 EXPECT_GE(second_install->version()->CompareTo(first_install_version), 0); | 158 EXPECT_GE(second_install->version()->CompareTo(first_install_version), 0); |
159 } | 159 } |
OLD | NEW |