OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test/automation/browser_proxy.h" | 5 #include "chrome/test/automation/browser_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 float start_ms = 0; | 621 float start_ms = 0; |
622 Value* tab_value; | 622 Value* tab_value; |
623 DictionaryValue* tab_dict; | 623 DictionaryValue* tab_dict; |
624 | 624 |
625 if (!tabs_list->Get(i, &tab_value) || | 625 if (!tabs_list->Get(i, &tab_value) || |
626 tab_value->GetType() != Value::TYPE_DICTIONARY) | 626 tab_value->GetType() != Value::TYPE_DICTIONARY) |
627 return false; | 627 return false; |
628 tab_dict = static_cast<DictionaryValue*>(tab_value); | 628 tab_dict = static_cast<DictionaryValue*>(tab_value); |
629 | 629 |
630 double temp; | 630 double temp; |
631 if (!tab_dict->GetReal("load_start_ms", &temp)) | 631 if (!tab_dict->GetDouble("load_start_ms", &temp)) |
632 return false; | 632 return false; |
633 start_ms = static_cast<float>(temp); | 633 start_ms = static_cast<float>(temp); |
634 // load_stop_ms can only be null if WaitForInitialLoads did not run. | 634 // load_stop_ms can only be null if WaitForInitialLoads did not run. |
635 if (!tab_dict->GetReal("load_stop_ms", &temp)) | 635 if (!tab_dict->GetDouble("load_stop_ms", &temp)) |
636 return false; | 636 return false; |
637 stop_ms = static_cast<float>(temp); | 637 stop_ms = static_cast<float>(temp); |
638 | 638 |
639 if (i == 0) | 639 if (i == 0) |
640 *min_start_time = start_ms; | 640 *min_start_time = start_ms; |
641 | 641 |
642 *min_start_time = std::min(start_ms, *min_start_time); | 642 *min_start_time = std::min(start_ms, *min_start_time); |
643 *max_stop_time = std::max(stop_ms, *max_stop_time); | 643 *max_stop_time = std::max(stop_ms, *max_stop_time); |
644 stop_times->push_back(stop_ms); | 644 stop_times->push_back(stop_ms); |
645 } | 645 } |
646 std::sort(stop_times->begin(), stop_times->end()); | 646 std::sort(stop_times->begin(), stop_times->end()); |
647 return true; | 647 return true; |
648 } | 648 } |
OLD | NEW |