| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 public: | 44 public: |
| 45 WebstoreInstallListener() | 45 WebstoreInstallListener() |
| 46 : received_failure_(false), received_success_(false), waiting_(false) {} | 46 : received_failure_(false), received_success_(false), waiting_(false) {} |
| 47 | 47 |
| 48 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE { | 48 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE { |
| 49 received_success_ = true; | 49 received_success_ = true; |
| 50 id_ = id; | 50 id_ = id; |
| 51 | 51 |
| 52 if (waiting_) { | 52 if (waiting_) { |
| 53 waiting_ = false; | 53 waiting_ = false; |
| 54 MessageLoopForUI::current()->Quit(); | 54 base::MessageLoopForUI::current()->Quit(); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual void OnExtensionInstallFailure( | 58 virtual void OnExtensionInstallFailure( |
| 59 const std::string& id, | 59 const std::string& id, |
| 60 const std::string& error, | 60 const std::string& error, |
| 61 WebstoreInstaller::FailureReason reason) OVERRIDE { | 61 WebstoreInstaller::FailureReason reason) OVERRIDE { |
| 62 received_failure_ = true; | 62 received_failure_ = true; |
| 63 id_ = id; | 63 id_ = id; |
| 64 error_ = error; | 64 error_ = error; |
| 65 | 65 |
| 66 if (waiting_) { | 66 if (waiting_) { |
| 67 waiting_ = false; | 67 waiting_ = false; |
| 68 MessageLoopForUI::current()->Quit(); | 68 base::MessageLoopForUI::current()->Quit(); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 void Wait() { | 72 void Wait() { |
| 73 if (received_success_ || received_failure_) | 73 if (received_success_ || received_failure_) |
| 74 return; | 74 return; |
| 75 | 75 |
| 76 waiting_ = true; | 76 waiting_ = true; |
| 77 content::RunMessageLoop(); | 77 content::RunMessageLoop(); |
| 78 } | 78 } |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 content::GpuDataManager::GetInstance()->InitializeForTesting( | 482 content::GpuDataManager::GetInstance()->InitializeForTesting( |
| 483 json_blacklist, gpu_info); | 483 json_blacklist, gpu_info); |
| 484 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( | 484 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( |
| 485 content::GPU_FEATURE_TYPE_WEBGL)); | 485 content::GPU_FEATURE_TYPE_WEBGL)); |
| 486 | 486 |
| 487 bool webgl_allowed = false; | 487 bool webgl_allowed = false; |
| 488 RunTest(webgl_allowed); | 488 RunTest(webgl_allowed); |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace extensions | 491 } // namespace extensions |
| OLD | NEW |