| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 void CancelDialog() { | 48 void CancelDialog() { |
| 49 app_modal::NativeAppModalDialog* dialog = nullptr; | 49 app_modal::NativeAppModalDialog* dialog = nullptr; |
| 50 ASSERT_NO_FATAL_FAILURE(GetNextDialog(&dialog)); | 50 ASSERT_NO_FATAL_FAILURE(GetNextDialog(&dialog)); |
| 51 dialog->CancelAppModalDialog(); | 51 dialog->CancelAppModalDialog(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void CheckAlertResult(const std::string& dialog_name, | 54 void CheckAlertResult(const std::string& dialog_name, |
| 55 size_t* call_count, | 55 size_t* call_count, |
| 56 const base::Value* value) { | 56 const base::Value* value) { |
| 57 ASSERT_TRUE(value) << dialog_name; | 57 ASSERT_TRUE(value) << dialog_name; |
| 58 ASSERT_TRUE(value->IsType(base::Value::TYPE_NULL)); | 58 ASSERT_TRUE(value->IsType(base::Value::Type::NONE)); |
| 59 ++*call_count; | 59 ++*call_count; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CheckConfirmResult(const std::string& dialog_name, | 62 void CheckConfirmResult(const std::string& dialog_name, |
| 63 bool expected_value, | 63 bool expected_value, |
| 64 size_t* call_count, | 64 size_t* call_count, |
| 65 const base::Value* value) { | 65 const base::Value* value) { |
| 66 ASSERT_TRUE(value) << dialog_name; | 66 ASSERT_TRUE(value) << dialog_name; |
| 67 bool current_value; | 67 bool current_value; |
| 68 ASSERT_TRUE(value->GetAsBoolean(¤t_value)) << dialog_name; | 68 ASSERT_TRUE(value->GetAsBoolean(¤t_value)) << dialog_name; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 // All dialogs must be closed now. | 160 // All dialogs must be closed now. |
| 161 app_modal::AppModalDialogQueue* queue = | 161 app_modal::AppModalDialogQueue* queue = |
| 162 app_modal::AppModalDialogQueue::GetInstance(); | 162 app_modal::AppModalDialogQueue::GetInstance(); |
| 163 ASSERT_TRUE(queue); | 163 ASSERT_TRUE(queue); |
| 164 EXPECT_FALSE(queue->HasActiveDialog()); | 164 EXPECT_FALSE(queue->HasActiveDialog()); |
| 165 EXPECT_EQ(0, queue->end() - queue->begin()); | 165 EXPECT_EQ(0, queue->end() - queue->begin()); |
| 166 while (call_count < num_accepted_dialogs + num_cancelled_dialogs) | 166 while (call_count < num_accepted_dialogs + num_cancelled_dialogs) |
| 167 ASSERT_NO_FATAL_FAILURE(content::RunAllPendingInMessageLoop()); | 167 ASSERT_NO_FATAL_FAILURE(content::RunAllPendingInMessageLoop()); |
| 168 } | 168 } |
| OLD | NEW |