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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 document_icons, | 88 document_icons, |
89 kAppName, | 89 kAppName, |
90 GURL(kAppUrl), | 90 GURL(kAppUrl), |
91 true); | 91 true); |
92 } | 92 } |
93 | 93 |
94 const DriveAppConverter* converter() const { return converter_.get(); } | 94 const DriveAppConverter* converter() const { return converter_.get(); } |
95 | 95 |
96 private: | 96 private: |
97 void ConverterFinished(const DriveAppConverter* converter, bool success) { | 97 void ConverterFinished(const DriveAppConverter* converter, bool success) { |
98 if (runner_) | 98 if (runner_.get()) |
99 runner_->Quit(); | 99 runner_->Quit(); |
100 } | 100 } |
101 | 101 |
102 scoped_ptr<DriveAppConverter> converter_; | 102 scoped_ptr<DriveAppConverter> converter_; |
103 scoped_refptr<content::MessageLoopRunner> runner_; | 103 scoped_refptr<content::MessageLoopRunner> runner_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(DriveAppConverterTest); | 105 DISALLOW_COPY_AND_ASSIGN(DriveAppConverterTest); |
106 }; | 106 }; |
107 | 107 |
108 IN_PROC_BROWSER_TEST_F(DriveAppConverterTest, GoodApp) { | 108 IN_PROC_BROWSER_TEST_F(DriveAppConverterTest, GoodApp) { |
(...skipping 41 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 |