OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 4077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4088 void runTest(const char* testFile) | 4088 void runTest(const char* testFile) |
4089 { | 4089 { |
4090 registerMockedHttpURLLoad(testFile); | 4090 registerMockedHttpURLLoad(testFile); |
4091 FrameTestHelpers::loadFrame(m_webViewHelper.webView()->mainFrame(), m_ba
seURL + testFile); | 4091 FrameTestHelpers::loadFrame(m_webViewHelper.webView()->mainFrame(), m_ba
seURL + testFile); |
4092 m_webViewHelper.webView()->layout(); | 4092 m_webViewHelper.webView()->layout(); |
4093 | 4093 |
4094 const WebSelectionBound* selectStart = m_fakeSelectionLayerTreeView.star
t(); | 4094 const WebSelectionBound* selectStart = m_fakeSelectionLayerTreeView.star
t(); |
4095 const WebSelectionBound* selectEnd = m_fakeSelectionLayerTreeView.end(); | 4095 const WebSelectionBound* selectEnd = m_fakeSelectionLayerTreeView.end(); |
4096 | 4096 |
4097 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); | 4097 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); |
4098 v8::Handle<v8::Value> result = m_webViewHelper.webView()->mainFrame()->e
xecuteScriptAndReturnValueForTests(WebScriptSource("expectedResult")); | 4098 v8::Handle<v8::Value> result = m_webViewHelper.webView()->mainFrame()->t
oWebLocalFrame()->executeScriptAndReturnValueForTests(WebScriptSource("expectedR
esult")); |
4099 if (result.IsEmpty() || (*result)->IsUndefined()) { | 4099 if (result.IsEmpty() || (*result)->IsUndefined()) { |
4100 EXPECT_FALSE(selectStart); | 4100 EXPECT_FALSE(selectStart); |
4101 EXPECT_FALSE(selectEnd); | 4101 EXPECT_FALSE(selectEnd); |
4102 return; | 4102 return; |
4103 } | 4103 } |
4104 | 4104 |
4105 ASSERT_TRUE(selectStart); | 4105 ASSERT_TRUE(selectStart); |
4106 ASSERT_TRUE(selectEnd); | 4106 ASSERT_TRUE(selectEnd); |
4107 | 4107 |
4108 ASSERT_TRUE((*result)->IsArray()); | 4108 ASSERT_TRUE((*result)->IsArray()); |
(...skipping 2237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6346 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6346 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6347 | 6347 |
6348 // Neither should a page reload. | 6348 // Neither should a page reload. |
6349 localFrame->reload(); | 6349 localFrame->reload(); |
6350 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6350 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6351 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6351 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6352 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6352 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6353 } | 6353 } |
6354 | 6354 |
6355 } // namespace | 6355 } // namespace |
OLD | NEW |